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

[Solved] Header Context Menu

2 Answers 157 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 04 Dec 2009, 10:06 PM
I have a RadGrid with the Header Context Menu enabled to allow users to select the columns they want to see. I'm currently using the OnColumnHidden and OnColumnShown client events to make an ajax request and save the user's preferences. Rather than saving the preferences after each column is shown/hidden, I would like to save them after the context menu is closed, if any changes were made.

I see that the grid has a client event for OnHeaderMenuShowing. However, I don't see an event for the menu hiding. Is there any way to tell when the header context menu is closed?

2 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetoslav
Telerik team
answered on 09 Dec 2009, 04:29 PM
Hi Peter,

 In order to achieve this scenario, you can attach a client handler to the grid's OnGridCreated event, get a reference to the client object of the context menu and attach the corresponding event handling method:

function gridCreated(sender, args) 
{
    sender.get_headerMenu().add_hiding(menuHiding)
}
function menuHiding(sender, args) 
{
      
}

I hope this helps.

Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Peter
Top achievements
Rank 1
answered on 09 Dec 2009, 08:10 PM
That does it, thanks!
Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Peter
Top achievements
Rank 1
Share this question
or