With MS Grid (DataGridView) I can have few cells selected... Then do:
BeginInit
dataGridView.DataSource = some data table
EndInit
And then it will refresh the cells on the grid but the selection will remain as it was.
With infragistics it is not possible.... If i try to set the datasource while I'm in BeginInit and then I do EndInit then the grid is not being updated no matter what I do.
I also tried to do SuspendLayout change the values in the datasource and then resumelayout, but then I look the cells selection.
Any other way around, or a better way to do that I want to do?
Thanks
BeginInit and EndInit are intended for use by the Visual Studio design environment. You really should never call these methods in your code.
If you have some selected cells in the grid and you change the grid's data source, the cells that were selected no longer exist. Those were cells that existed in the previous data source. The new data source has a completely new set of rows and cells, so there's no way to the grid can maintain the selection.
You could store the indices of the selected rows and cells yourself and then re-apply them after changing the DataSource.
I thought that you might say that...
oh well, I guess I'll have to do it the hard way.
Thanks.