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

Persist grid state silently

1 Answer 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 26 May 2011, 09:54 PM
Hello,

I am trying to persist grid state behind the scenes without requiring the user to take any action. I have implemented a GridSettingsPersister class and it works perfectly on button click.  I have implemented the ICallbackEventHandler interface to call my server-side persistence method and hooked-up calls from OnColumnHidden, OnColumnShown and OnTableDestroying.

My only issue revolves around persisting column reorder changes - on the server side (with <ClientSettings ReorderColumnsOnClient="true") the OnColumnsReorder event seems to be the in-process event (i.e. OnColumnsReordering) but there doesn't appear to be any corresponding post-process event (i.e. OnColumnsReordered) - the client side (<ClientSettings ReorderColumnsOnClient="false") exposes both events for a move right or left (OnColumnMovingToLeft, OnColumnMovedToLeft, OnColumnMovingToRight, OnColumnMovedToRight) [ Side note: the 'OnColumnMovingTo' methods seem to be misnamed Right should be Left and vice-versa] but the events only fire for the first column exchange so when a column is reordered more than a single spot I can't find any way to get the final position to set the OrderIndex.

I have a small (7.35 MB) sample app if needed.

Thanks for your help.

Regards,

Steve

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 01 Jun 2011, 09:30 AM
Hi Steve,

You should set ReorderColumnsOnClient="false" in order for the ColumnsReorder event to work as expected. If you still do not manage to execute your logic using the event arguments exposed in it, you could only raise a flag in this event, to use as a check in the RadGrid PreRender event and save the OrderIndexes of the columns there.

Regards,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Steve
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or