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
405
Show / hide columns depending of the groups.
posted

Hello

 

I have an ultragrid with several groups of rows (an hidden column is grouped by).
How can I show / hide different columns  in the different groups ? For instance, in the first group of rows I want the first column to be displayed and not the second one; and in the second group of rows I want the second column to be displayed and not the first one.

 

Any help is welcome =)

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    You cannot. The columns are defined at the band level, and since each group is part of the same band, there's no way to define different columns per group.

    If the column headers do not need to change and you simply want to show a different value in a cell based on the group, perhaps by choosing one column or another whose value you want to display, then you could achieve this using an unbound column. What you would do is hide the two "real" columns and then use the InitializeRow event to populate the unbound column based on the group column value.

    Another possible option would be to use an UltraWinTree instead of using UltraWinGrid. The tree does not have any built-in grouping functionality, but it does allow heterogeneous data sources. So you could create a Data source which exposes a different set of columns under each parent row and then populate that data source with the grouped data (doing the grouping yourself).

Children