DataGrid on WinForm

  • Thread starter Thread starter Vai2000
  • Start date Start date
V

Vai2000

Hi All, I have a dataview binded to a datagrid. I do some filter on the
view, how can I get the filtered list displayed on the DG in my code
The DG is on Winform

TIA
 
If you apply the filter to the data source, call DataGrid.DataBind() to
refresh the grid's view of the datasource.

Pete
 
there is not DataBind on Winform...
I need the grid contents on the code side...if I do a .DataSource I get the
original List not the filtered.

Thx
 
My apologies. Don't know what I was thinking. You did specify winform in the
topic...

Can you provide some sample code for creating the filter and binding the
datagrid?

Setting the RowFilter should update the grid automatically.

Pete
 
Thanks Pete, I guess I have found the solution

DataView dv as dataGrid1.DataSource;
foreach(DataRowView dr in dv)
{
object [] arr=dr.Row.ItemArray;
}
 
Back
Top