Home Forums WinForms controls Xceed Grid for WinForms Checkbox in Columns

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #12629 |

    Has anyone has any success at implementing checkboxes in the title of a column, so the entire column can be selected?

    The goal is to be able to select a checkbox in the beginning of a row (which has been done easily enough) and a checkbox at the top of a column so that a specific cell or cells can be determined.

    If anyone has any ideas how to implement this, I’d love to hear from you.


    Imported from legacy forums. Posted by JIpock (had 2984 views)

    User (Old forums)
    Post count: 23064

    Hi Jason,

    There are two possible options that might be of interest to you:

    1- You can use a ValueRow that has a GridCheckBox as a viewer and editor for the desired column and, if your user checks that cell, then it checks all checkboxes in the corresponding column. Of course, the ValueRow would be in the grid’s FixedHeaderSection if you do not want it to scroll with the grid body.

    2- If you want the CheckBox to be in the ColumnManagerRow, then you will need to create a class that derives from the ColumnManagerRow class and override the PaintForeground method. In the PaintForeground method, you can then use the Framework’s ControlPaint.DrawCheckBox method to paint the checkbox (according to its state). The only problem you might encounter with this solution is that when you click on the ColumnManagerRow, the grid will be sorted according to the values of that column. You can always set the columns AllowSort property to false to prevent it from being sorted though.

    I hope this helps!

    Imported from legacy forums. Posted by Matt (had 4554 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.