views:

185

answers:

2

how i can view new rows in datagridview added to list that is previously assigned as datagridview.datasource?

+2  A: 

You need to re-call the databind() method to see any updates to the data.

brendan
i have this code to data grid view list<businessEntity.group> groupList;DataGridView1.DataSource = groupList;how i will write databind()??!!please......explain ......
DataGridView1.DataBind(); - simple as that
brendan
+1  A: 

On WinForms:

If the list doesn't automatically notify the DataGridView of changes, the only way I know to display the new rows is to set the DataSource to null and then back to your list again.

You should probably be using a BindingSource here to both make your life easier and avoid visual hiccups in the UI. Bind the DataGridView to the BindingSource and the BindingSource to your list. Then you can just call BindingSource.ResetBindings(false) to update it with your new rows.

lc