Hi,
I have added a checkbox column in my ulrawingrid using the following code
grid.DisplayLayout.Bands[0].Columns.Add(checkboxName, checkboxCaption); grid.DisplayLayout.Bands[0].Columns[checkboxName].DataType = typeof(bool); grid.DisplayLayout.Bands[0].Columns[checkboxName].CellClickAction = CellClickAction.Edit; grid.DisplayLayout.Bands[0].Columns[checkboxName].Header.CheckBoxVisibility = HeaderCheckBoxVisibility.Always; grid.DisplayLayout.Bands[0].Columns[checkboxName].Header.CheckBoxSynchronization = HeaderCheckBoxSynchronization.Band; grid.DisplayLayout.Bands[0].Columns[checkboxName].CellActivation = Activation.AllowEdit; grid.DisplayLayout.Bands[0].Columns[checkboxName].Group = grid.DisplayLayout.Bands[0].Groups[ultraGroupKey]; SetCheckBoxAtFirstPosition(grid, checkboxName);
In the CellChange event of grid I am checking the e.Cell.Column.Key and if it is the same as checkbox then I am enabling/disabling some columns based on it.But inside the CellChange event the value of the cell is not correct. So I have used Cell.Text which is currently correct.
The problem is the event is not being fired when using the checkbox on the top of the grid to select all the checkboxes.
How can I effectively get the change event for the checkbox. Also will the text value of the cell work in all cases and will not be finicky?
Hello Puneet,
You may want to try using the BeforeHeaderCheckStateChanged and/or AfterHeaderCheckStateChanged events instead of using the CellChange. The reason for this is because the Before event provides the folling event args. (i.e. Column, CurrentCheckState, NewCheckState, Rows). These events fire between the time you click the checkbox at the top of a column and as it the change is committed.
http://help.infragistics.com/Doc/WinForms/Current/CLR4.0/?page=Infragistics4.Win.UltraWinGrid.v13.2~Infragistics.Win.UltraWinGrid.UltraGridBase~BeforeHeaderCheckStateChanged_EV.html
May I ask if you have tried using the value property of the cell as well? The text property of a cell for example, if a cell is in edit mode will return the text in the editor being used. For more details regarding these two properties in comparison please visit the following page: http://help.infragistics.com/Doc/WinForms/Current/CLR4.0/?page=Infragistics4.Win.UltraWinGrid.v13.2~Infragistics.Win.UltraWinGrid.UltraGridCell~Value.html
Let me know if this helps. Please provide an isolated sample if you wish to provide additional information if you are still having issues. Thanks in advance.