This is a migrated thread and some comments may be shown as answers.

ContextMenu with mutually exclusive behaviour (group/ungroup)

0 Answers 36 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Borralis
Top achievements
Rank 1
Borralis asked on 21 Dec 2011, 01:07 PM
Hi,

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?

No answers yet. Maybe you can help?

Tags
Menu
Asked by
Borralis
Top achievements
Rank 1
Share this question
or