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

Rad Context menu - context

1 Answer 32 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raj
Top achievements
Rank 1
Raj asked on 02 Dec 2008, 07:33 AM
I have a requirement to maintain  the state of context menu across the application.

Eg: If I selected a particular item in the context menu and that item should be highlighted with a different color. Next time again if I open the context menu, the selected menu item should be highlighted with that specified color.

Is there any method to achieve this requirement?

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 02 Dec 2008, 09:58 AM
Hello Raj,

Sample approach illustrating how to access the header context menu:
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    RadGrid1.HeaderContextMenu.ItemCreated += new RadMenuEventHandler(HeaderContextMenu_ItemCreated); 

Change the style of a chosen item:
void HeaderContextMenu_ItemCreated(object sender, RadMenuEventArgs e) 
    if (e.Item.Level == 1 && e.Item.Index == 2) 
        e.Item.CssClass = "myClass"

Depending on your scenario you can choose the best way to persist the state.

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Raj
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or