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

RadGridView - Restoring user's preferred column display sequence

3 Answers 103 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Frank A
Top achievements
Rank 1
Frank A asked on 20 May 2014, 08:48 PM
Hi!  I'm a forum newbie so please be gentle.   I've inherited control of an application for which I am not the original author, so bear that in mind :)

I've seen a few threads discussing how to handle restoring a column (display) sequence mod resulting from a user session. It looks like my previous developer used the standard template for preserving and applying column display sequences.  

So, user drags some columns around to suit their eye.  The app preserves the column information in the isolated storage and everything is good... until we try to restore the preferred sequence on the next log in. 

In the app work from the preserved collection of column settings, we traverse that stored list and reapply the DisplayIndex values to the predefined grid view, moving the columns to the preferred sequence.

The problem I'm seeing is the tendancy of the RadGridView control to re-sequence all the columns so there are no display gaps.  Is there any way to disable that behavior temporarily until I can restore my full list of revisions?    I guess I can do some complex ordering of the data I'm processing but I prefer not to go through heroic measures.

Consider the following default sequence (letters are named columns, number is the displayindex)

a, b, c, d, e, f, g, h
1, 2, 3, 4, 5, 6, 7, 8.

we resequence so that G & H appear earlier in the list... this is more of a visual representation since the column index itself doesn't move.

a, b, g, h, c, d, e, f
1, 2, 3, 4, 5, 6, 7, 8

This order is preserved in the isolated storage.  

User logs off & back on... the default column storage is restored. The problem doesn't occur until we hit the 3rd & 4th column elements.

a, b, c, d, e, f, g, h
1, 2, 5, 3, 4, 6, 7, 8

At the point that we set "c"'s column. DisplayIndex to 5, "d" becomes DisplayIndex 3, "e" becomes 4.... things are ok so far.

Next restoration is for "d" which DisplayIndex become 6.  In the app the system knows we need to now populate a 3 someplace. unfortunately for me it resets the DisplayIndex for "c" to be 3...   this throws off my expected display.

I haven't gone through the programmatic sorting adjustment for this because my instinct says there's always going to be a situation where I can't compensate for the user pattern, so I'm hoping this is addressable with a control property.


I admit my RadGridView version is quite ancient (2010.1.309.1030) maybe this just hasn't been addressed? I see the WinForm version of this control has a Move method but that's not an option for me here.


Let me know if I'm being too confusing or if code snippets are required.  Thanks in advance for any guidance.

 

3 Answers, 1 is accepted

Sort by
0
Frank A
Top achievements
Rank 1
answered on 21 May 2014, 12:45 PM
(Obviously the indexes start from 0, but you get the point. if there are gaps in the sequences as we're rolling them out of the saved settings the set values get reset automatically)
0
Boris
Telerik team
answered on 23 May 2014, 03:06 PM
Hello Frank,

This is a known issue and I am happy to tell you that it was fixed in one of our internal builds. Have you considered updating to the latest one ?

With our UI for Silverlight controls you will be able to take full advantage of many new controls. You can find examples for all of them in our online demos for Silverlight. One of those controls is RadPersistenceFramework with which you will be able to easily persist all of the GridView settings. For more information about that you can check our GridView Serialization online demo.


Regards,
Boris Penev
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Frank A
Top achievements
Rank 1
answered on 23 May 2014, 03:10 PM
very very cool, thank you for the information!  will consider updating as opposed to coding around it :)
Tags
DataForm
Asked by
Frank A
Top achievements
Rank 1
Answers by
Frank A
Top achievements
Rank 1
Boris
Telerik team
Share this question
or