DataGrid on WinForm

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
 
P

Pete Davis

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

Pete
 
V

Vai2000

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
 
P

Pete Davis

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
 
V

Vai2000

Thanks Pete, I guess I have found the solution

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top