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

Saving RadGridView Customizations with an Image Header

3 Answers 69 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Chuck
Top achievements
Rank 1
Chuck asked on 12 Mar 2012, 09:24 PM
I'm using the PersistenceFramework (and associated sample code, e.g. GridViewCustomPropertyProvider) to save user customizations made to a RadGridView. The class GridViewCustomPropertyProvider makes an assumption that the contents of column.Header property will be some sort of string value. This is also evidenced by the type for Header in the ColumnProxy, that is, a String. Has anyone seen this as a limitation, and be willing to share what they've used as a workaround?
Thanks,
Chuck

3 Answers, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 15 Mar 2012, 02:48 PM
Hi Chuck,

The GridViewCustomPropertyProvider implementation is simply an example demonstrating how to configure the RadGridView persistence. Basically the RadPersistenceFramework uses the ICustomPropertyProvider implementation to save a set of properties. And creating a custom implementation of that interface allows you to control this set of properties.

The sample in our demos demonstrates how to save a few Column properties along with the Filter/Sorting and Group settings. And it is based on a sample scenario where the Header of the Columns is a string. But if your scenario uses another type of header, then you can modify the GridViewCustomPropertyProvider class to better fit your needs.

For that purpose you need to change the type of the Header property in the ColumnProxy class and the ProvideValue() method. If you have any troubles implementing it, you can send us a sample project demonstrating your scenario and we will guide you through it.

Greetings,
Tina Stancheva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Chuck
Top achievements
Rank 1
answered on 15 Mar 2012, 02:55 PM
Tina,
Thanks for the reply. Yes, I am becoming familiar with the GridViewCustomPropertyProvider! I have modified the Header property to take an Object, and am in the process of making modifications so that it takes an Image, as well.
Thanks,
Chuck
0
Jeff
Top achievements
Rank 1
answered on 04 Feb 2014, 04:43 AM
Just as a note to others who may find this post, you may also find a similar problem arise when following suggestions to set the Header property of the column to a instance of TextBlock with TextWrapping property set accordingly in order to get the header text to wrap. Looking at the implementation it's unclear why the example implementation even suggests persisting the value stored as the Header as it seems to be something that doesn't make sense to persist. Can anybody give an example where persisting the header gives some kind of benefit or solves some issue that not having it would otherwise pose.
Tags
PersistenceFramework
Asked by
Chuck
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Chuck
Top achievements
Rank 1
Jeff
Top achievements
Rank 1
Share this question
or