Which ultragrid event catches, checking or unchecking of a checkbox?
I am not looking for AfterCellUpdate as this has to be applicable
only for checkbox and not for other cells.
Hi Nipun,
All fields in the grid are editable by default. So if you cannot change the value of the cell, either you are explicitly telling the grid not to allow editing, or your data source does not allow editing.
This KB article describes all the ways in which you might be disabling the cell in the grid:
HOWTO:How can I make a grid or a column, row, or cell in the UltraWinGrid disabled or read-only?
So you could check to see if you are setting any of those properties. If not, then your data source probably doesn't allow that field to be changed.
Dear Mike,
I am binding grid to a datasource which is having a bool column. This column appears as a checkbox column in the grid.
But i am unable to check or uncheck on the checkbox.
Can you please tell what property we need to set so that user should be able to check or uncheck the checkboxes in the column.
Regards,
Nipun Anand
I typically use CellChange. It's better than AfterCellUpdate because it fires immediately when the user checks or unchecks, it doesn't wait until the leave the cell.
The only trick it, you have to use the Text property of the cell instead of the Value, because the Value won't be updated, yet.
There's no event that fires exclusively for checkbox cells. But you can check the cell.Column.Key or even cell.Column.DataType and ignore other columns very easily.
I don't think there is a special one for checkbox cell, but you can check it in the AfterCellUpdate event:
if (e.Cell.StyleResolved == ColumnStyle.CheckBox)
You can also make a CustomControl that inherits UltraGrid and create an event that fires only if AfterCellUpdate gets fired for a checkbox.