Hi,
In my grid, the first column is a checkbox column.
The header checkbox is uses for select all /clear all
But when I change the cells checkbox or the grid lost the focus and then I try to check the header check box(the check box is unchecked)he always make un-check to all the check box in the column instead of checked the header check and all the column checkboxs.
I succeed to solve this when I add the following code to the event BeforeHeaderCheckStateChanged:
if (e.NewCheckState == CheckState.Indeterminate) { e.NewCheckState = e.CurrentCheckState;
}
But at the first load, the checkbox column work OK but when I reload the grid with new bind I need to press twice on each checkbox to change the checkbox to check
how I can solve this issue?
Thanks
Nirit
Hi Nirit,
Thank you for posting to our forums.
The code in the BeforeHeaderCheckStateChanged will prevent the header checkbox from going into Indeterminate state (when the values in the column are not all true and false). However I am not sure what exactly do you mean by “press twice on each checkbox to change the checkbox to check”. Do you mean that the header checkbox isn’t changing or the checkboxes for the cells? Can you provide me with a small sample that reproduces this issue?
I am looking forward to hearing from you.
Thanks Dimitar,After I search again in yours forum, I found that my problem is the data type of the checkboxs column that he need to be Boolean.After I updated my SQL query, all the grid checkboxs problems were solved
Thank you for your help