Gridview is not filling the empty spaces when filtering the content

Hi guys, Im filtering the gridview in the reference pictures, the first picture shows the ctegory Dropdown without beeing selected so the gridview shows the whole query, but in the second photo, is selected a category, and the gridview is showing the correcte results but hi isnt filling the spaces in order, it is leaving the content in the same position they are when the query has no filters. Can any body help me. Thanks

1