I am manually setting a value of a cell by the following way:
{
gridRow.Cells[ColumnName].Value = "Test";
}
However, when I tried to change the value or clear by the same method, the original value is maintained. Isn't this allowed? Or, why setting it works, but not afterwards?
(I have the grid bound to BindingList, and the above column indicated by "ColumnName" is added manually at run-time with the following code. Isn't this correct?)
Grid.DisplayLayout.Bands[0].Columns.Add(ColumnName);
Grid.DisplayLayout.Bands[0].Columns[ColumnName].Hidden = true;
I'm not sure I understand your question. You are saying that this code just has no effect? I don't see how that's possible. Perhaps your code is re-setting the value of the cell back to the original value somewhere else, like in the InitializeRow event?
Thanks for your response.
No, I don't have any other location that resets as I am not using InitializeRow event.
Maybe, do I have to use BeginUpdate and EndUpdate before and after the modification?
In my case of adding/removing unbound column (a manual column during run-time), and setting/resetting values, what are the most standard way of doing it?