DataTable - Filtering

NachitoMax 416 Reputation points
2021-09-09T22:27:36.867+00:00

Hi

Im having a small issue with filtering a DataTable. I have tried various options, all not quite returning the result needed. I need to return a filtered list as a DataSource to a DataGrid based on a Column(Group) value(SIZE)

I did this
_PT 'This is the datatable

Dim DR as DataRow() = _PT.Select("Group = 'SIZE'")

MyGrid.DataSource = DR

When i do this, i get the correct amount of rows but no data.

If i add the table as the DataSource

MyGrid.DataSource = _PT

i get all of the results and i can see the data.

What am i doing wrong? How am i able to filter the table itself without a DataRow() to see the filtered results in the Grid?

Thanks

Developer technologies .NET Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. NachitoMax 416 Reputation points
    2021-09-09T22:33:51.857+00:00

    straight after the post i managed to figure it out....

     Dim DV As New DataView(_PT) With {.RowFilter = "Group = '" & _Filter & "'"}
    

    Thanks

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.