c# - How to access records after using RowFilter on DataGridView? -
I have DataGridView on which I have used the RowFilter
on the following:
(as dgv.DataSource as DataTable). Defaultviewfourfilter = whereclose; Record 1087 in DataGridView before applying
and after that, 8 .
Now I want to work on those 8 records.
If you
< P> ex>
dgv.DataSource as DataTable
then you can do
dataTable dt = dgv.DataSource DataTable in the form of; Detroit [] rows = DT. Select ("Your filter goes here");
If you want you can do this by Linq. These are your rows and you can work with them. And to edit only these records:
DataGridView.DataSource = rows; In addition, you can create a custom DataView
, which will filter the records you want and set the data source on that view. But remember, the key here, regardless of how many ideas you have - this is the data that you are seeing dataview view = new data view (); See. Table = dt; See. Rofilter = "your filter"; See. Sir = "your way";
Comments
Post a Comment