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
680
Merging column headers in ultragrid
posted

I need to merge two column headers that are side-by-side into a single column header. How do I do that? I'd like the columns themselves to remain separate. I just want the header to look like  a single header.

Parents
  • 469350
    Offline posted

    Hi,

    There's no way to do this via simple property settings.

    But there are a couple of ways you can achieve what you want. It's going to depend on what version of the controls you are using, though.

    If you have a pretty recent version, then you could set the RowLayoutStyle on your grid to GroupLayout. Then you put the two columns into a group and hide the columns headers so that the group header takes the place of the column headers.

    If you have an old version of the controls, then you may not have the option for GroupLayout, so you could use a RowLayout with an unbound column. You use the column.RowLayoutColumnInfo.LabelPosition to hide the column headers for the two real bound columns and hide the cells (LabelOnly) for the unbound column. The unbound column's header will act as the combined header for the two real columns.

    A third option, which will work in any version of the grid but is a bit harder to implement it to use a CreationFilter to remove the UIElement for one of the column headers and extend the other into the empty space thus created.

    This will be tricky, though, especially if you are not experienced with CreationFilters.

Reply Children