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

Save selected options of HEADER CONTEXT MENU

3 Answers 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
July
Top achievements
Rank 2
July asked on 03 Nov 2011, 07:24 PM
Hello! I need save the preferences of user.
I user hide X columns from Header Context menu, order, etcc I need save it.
which is the events of Header Cotext menu, that i can use for that?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 1
answered on 04 Nov 2011, 04:37 AM
Hello Julieta,

Check the following demo which implements the same functionality.
Grid / Persisting Grid Settings.

Thanks,
Shinu.
0
July
Top achievements
Rank 2
answered on 06 Nov 2011, 12:15 AM
Hi Shinu!
I need exactly this BUT dynamically, it meas, ehrn user  leave HeaderContextMenu, or When change page/close apo
Where i can code this?
Thanks
0
Accepted
Shinu
Top achievements
Rank 1
answered on 07 Nov 2011, 06:02 AM
Hello Julieta,

You can access the column in OnColumnHiding client event of RadGrid and store that in a HiddenField and can access from the server side. If you want to use it across the web pages, then you can make AjaxRequest and store that HiddenField value in a session variable.

JS:
<script type="text/javascript">
 function OnColumnHiding(Sender, args)
 {
    document.getElementById("HiddenField1").value = args.get_gridColumn().get_uniqueName();
    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
    ajaxManager.ajaxRequest(arguments);
 }
</script>

C#:
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
 {
   Session["hidecol"] = HiddenField1.Value;
 }

Thanks,
Shinu.
Tags
Grid
Asked by
July
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 1
July
Top achievements
Rank 2
Share this question
or