Hi,
I've got an ultragrid on a form bound to some data and one unbound boolean(checkbox) column used to select rows. Now, when I select a row I use the CellChange event to do some other things I need to do. The problem I have is that inside the CellChange the checkbox column's value is always false. If I use AfterCellUpdate, I don't get notified right after I click the checkbox which is basically what I need. Any way to achieve it?
Thanks,Cosmin
Cosmin,
If you don't want to have to commit the value of the cell at that point, you could also check the Value on the editor of the active cell, i.e.:
bool isChecked = (bool) this.ultraGrid1.ActiveCell.EditorResolved.Value;
This of course assumes that the current active cell is your checkbox column, but then you wouldn't be having this problem if it wasn't :-)
-Matt
Thanks guys,
I actually ended up using both methods as it gets messy with the editorresolved.value only if the user doesn't leave the cell and clicks again on it. Anyway I fixed it, thanks again.
The easiest way to do this is to use the CellChange event and use the Text property of the cell, rather than Value. You will have to parse the text into a Bool, of course, but that's easy enough to do.