Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / How to default the 'Check All Rows' checkbox in header of a cell

How to default the 'Check All Rows' checkbox in header of a cell

New Discussion
Michael Fazio
Michael Fazio asked on Nov 1, 2017 7:17 PM

Hi,

How can I default the highlighted value so that it is not checked?

Thanks!

M.

Sign In to post a reply

Replies

  • 0
    Michael Fazio
    Michael Fazio answered on Oct 31, 2017 3:58 PM

    Sorry the image did not save I had to attached. See attached.

    • 0
      Mike Saltzman
      Mike Saltzman answered on Oct 31, 2017 7:01 PM

      Hi,

      The header checkbox defaults to unchecked. So I don't know why yours is checked. How are you turning on the header checkboxes? Are you setting the HeaderCheckBoxSynchronization?

      To explicitly set the value of the checkbox, you call the SetHeaderCheckedState method on the column. And you have to pass in the rows collection. In your case, since your screen shot shows child rows, you would have to call it for the child rows of every parent row.

      • 0
        Michael Fazio
        Michael Fazio answered on Oct 31, 2017 9:04 PM

        Thanks Mike.

        This is what we have in our Init Layout event for the grid…maybe the issue is here? We have not set anything manually in the designer.

        e.Layout.Bands[1].Columns["export"].Header.Caption = "Select to Export";
        e.Layout.Bands[1].Columns["export"].Width = 140;
        e.Layout.Bands[1].Columns["export"].Header.Appearance.TextHAlign = Infragistics.Win.HAlign.Center;
        e.Layout.Bands[1].Columns["export"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox;
        e.Layout.Bands[1].Columns["export"].Header.CheckBoxAlignment = HeaderCheckBoxAlignment.Left;
        e.Layout.Bands[1].Columns["export"].Header.CheckBoxSynchronization = HeaderCheckBoxSynchronization.RowsCollection;
        e.Layout.Bands[1].Columns["export"].Header.CheckBoxVisibility = HeaderCheckBoxVisibility.Always;

        Thanks,

        Michael

      • 0
        Michael Fazio
        Michael Fazio answered on Oct 31, 2017 9:04 PM

        Thanks Mike.

        This is what we have in our Init Layout event for the grid…maybe the issue is here? We have not set anything manually in the designer.

        e.Layout.Bands[1].Columns["export"].Header.Caption = "Select to Export";
        e.Layout.Bands[1].Columns["export"].Width = 140;
        e.Layout.Bands[1].Columns["export"].Header.Appearance.TextHAlign = Infragistics.Win.HAlign.Center;
        e.Layout.Bands[1].Columns["export"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox;
        e.Layout.Bands[1].Columns["export"].Header.CheckBoxAlignment = HeaderCheckBoxAlignment.Left;
        e.Layout.Bands[1].Columns["export"].Header.CheckBoxSynchronization = HeaderCheckBoxSynchronization.RowsCollection;
        e.Layout.Bands[1].Columns["export"].Header.CheckBoxVisibility = HeaderCheckBoxVisibility.Always;

        Thanks,

        Michael

      • 0
        Mike Saltzman
        Mike Saltzman answered on Oct 31, 2017 9:19 PM

        Hi Michael, 

        Okay, so you have it set up to Synchronize the header checkbox with the column automatically. But in the screen shot, there is only one row and it's unchecked, and yet the header is checked. So my only guess is that the DataType of the column is set to something that the header checkbox cannot interpret as a Boolean. 

        Is this a bound column or is it unbound? If it's a bound column, check the DataType. If it's unbound, then you probably just need to set the DataType to Boolean. 

      • 0
        Michael Fazio
        Michael Fazio answered on Nov 1, 2017 7:17 PM

        Hi Mike,

        That did the trick. In the datatable there was no type for the field. Set it to bool and works like a charm.

        Cheers,

        M.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Michael Fazio
Favorites
0
Replies
6
Created On
Nov 01, 2017
Last Post
8 years, 3 months ago

Suggested Discussions

Tags

Created by

Created on

Nov 1, 2017 7:17 PM

Last activity on

Feb 20, 2026 12:26 PM