ContextMenu with mutually exclusive behaviour (group/ungroup)

1 posts, 0 answers
  1. Borralis
    Borralis avatar
    5 posts
    Member since:
    Dec 2011

    Posted 21 Dec 2011 Link to this post


    In a ContextMenu how do I make this:

    - Show only "Group" option when the column is ungrouped (not for all the column, just for the column that is ungrouped).

    - Show only "Ungroup" option when the column is grouped.



    I tried this:

    But this hides both (group/ungroup options)
    void HeaderContextMenu_GroupsChanging(object sender, GridGroupsChangingEventArgs e)
        if (e.Action == GridGroupsChangingAction.Group)
                this.MasterTableView.GetColumn(e.Expression.GroupByFields[0].FieldName).Groupable = ...;
        else if (e.Action == GridGroupsChangingAction.Ungroup)
            this.MasterTableView.GetColumnSafe(e.Expression.GroupByFields[0].FieldName).Groupable = ...;

    Any help?
Back to Top