Saving RadGridView Customizations with an Image Header

4 posts, 1 answers
  1. Chuck
    Chuck avatar
    10 posts
    Member since:
    Sep 2012

    Posted 12 Mar 2012 Link to this post

    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
  2. Answer
    Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 15 Mar 2012 Link to this post

    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 >>
  3. DevCraft banner
  4. Chuck
    Chuck avatar
    10 posts
    Member since:
    Sep 2012

    Posted 15 Mar 2012 Link to this post

    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
  5. Jeff
    Jeff avatar
    25 posts
    Member since:
    Feb 2009

    Posted 03 Feb 2014 in reply to Tina Stancheva Link to this post

    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.
Back to Top