Question
3
Replies
1708
Views
Posted: August 1, 2017
Last activity: August 2, 2017
Closed
How to SELECT/filter rows given a particular condition on a DataGrid/Data Table?
Hi,
I would like to SELECT the rows where column contains specified value.
Example: I would like to SELECT records where Country = "US"
ID | Name | Country
--------------------------
1 | John | US
2 | Fred | Canada
3 | Ben | US
Expected Result: Should return Data Table.
ID | Name | Country
--------------------------
1 | John | US
3 | Ben | US
Thanks
It depends on what you desired result is, but the TableView component is the simplest option. It attaches to a LookupTable and allows you to filter using standard System.Data.DataTable filter syntax. Additionally, it has a ToTable method which you can use to output a filtered DataTable with. It can be used as a DataSource for a DataGrid as well.