I bind a huge data table into a Grid. We have several columns where we tend to hold data that needs to go in as bulk updates and there are few flagable columns that user clicks that require instateneous updates. When the instantenous updates takes place we tend to change the bit immediately in the cell rather than fetching and bind again. During this occasion the Row.DataChanged and Cell.DataChanged are set to true. I wanted to find out if thre is any way I can control that bit. I have also noticed, that the datatable some how does not have a full link between the grid after binding, in the sence when I update the grid, the datagrid's row changed bit does not happen.
1) The grid has to be bound to something, so I don't see what you mean here. Assuming that you don't get any exceptions currently when you change a value and select a different row, I don't foresee any issues directly related to calling the Update method.
2) I don't think that there's a way to get this list automatically. You would likely have to loop through all the rows in the grid and check the DataChanged flag. If you simply want to cause all data to be committed to the data source, you could call the UpdateData method on the grid.
3) If by ReadOnly you mean that you set the CellActivation of the column to something like ActivateOnly, NoEdit, or Disabled, then this flag will be updated when you programmatically change the value. However, if the data source itself doesn't allow the column to be edited for whatever reason, I don't think that the grid will allow you to update it.
4) I'm not familiar with the WebGrid, so you'd be better off posting this question in the ASP.NET forum.
-Matt
This is great. I can use the UpdateMode and manually construct my updates. But I do have some extra questions before I go changing things.
1) I am not using any datasouce objects, Will the Grid.Update or Row.Update throw any exceptions when called (I might call just to change the state of the row)?
2) What will be the beast and easiest way to get only the list of modified rows. Is there any properties that can give me the List of rows.
3) When a value is changed in a readonly column programmatically will the DataChanged trigger happen?
4) Is the UpdateMode similar in the UltraWebGrid?
You might want to take a look at hte UpdateMode property of the grid. I don't really think that there is a way to specifically set these flags, but the grid will, by default, not commit changes to the underlying data source until the ActiveRow has changed, or the grid has lost focus. You could force this to occur through the Update method on the row, or by changing the UpdateMode property.