Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
95
Header checkbox
posted

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

Parents
No Data
Reply
  • 23930
    Offline posted

    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.

Children