Suppose you have bound a Dataview to a Datagrid, then what do u expect?
You expect that the changes that you make to ur DataView will be reflected to the DataGrid immediately. But sometimes it doesn't and it will really make u tensed. But how?? Ok, let me expalin.
To bind a DataView to a DataGrid you just write the following lines of code.
DataGrid dg;But sometimes when insert rows in the DataView or make any changes you don't see the reflection in the DataGrid. But when this scenario occurs?
dg.DataSource = dv;
I observed this happens when you bind more than a ComboBox or a DateTimePicker with any column of the DataView's Table.
But I found a solution of this disgusting problem.
Just write following lines after making change to the DataView.
dg.DataSource = null;Then you will see the reflection immediately.
dg.DataSource = dv
But this is a funny solution. Because the DataSource of the dg was dv from the very beginning and still it is. But to get the reflection you have to change the datasource of the dg and again assign to ur dv. Null is a better choice here.
And the interesting fact is that MS hasn't solve this bug yet in .NET2.0
DataGridView of .NET2.0 has still the same problem.
(Note: I observed this phenomena in desktop development and I am not sure about Web)