Filter parameter display name binding

5 posts, 0 answers
  1. Adam
    Adam avatar
    6 posts
    Member since:
    Apr 2009

    Posted 22 Jul 2010 Link to this post

    How can I get the filter parameter to display the column name, rather than the property name, to which it is bound? I can't want to expose my property names to a user. Not only because it doesn't support localisation and multi-word properties but in several places I use proxy class with auto generated property names. I can't expose Ash_&pc_Ad324553kjfds5 as a filter parameter to a user.

    Thanks.
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 23 Jul 2010 Link to this post

    Hi Adam,

    RadDataFilter does not have a notion of a column name, since it does not have columns. So I am not sure what this column name is and where does it come from.

    RadDataFilter supports the DisplayAttribute.ShortName data annotation.

    So you can write thin on top of your property:

    [Display(ShortName="Something")]
    
    I hope this helps.
    
    More on data annotations you will find here.
    


    Sincerely yours,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. david mcintyre
    david mcintyre avatar
    31 posts
    Member since:
    Mar 2010

    Posted 12 May 2011 Link to this post

    Hi Ross, does the raddatafilter support localization for the ShortName?  If I set the ResourceType then the entire Display attribute is ignored by the filter, and the property name is displayed.  Here's my (nonworking) metadata:
    [Display(Order = 1, ShortName = "ItemID", ResourceType = typeof(MyAppResources))] 
                   [Display(Order = 1, ShortName = "Item ID")] 
                   public int ItemID { get; set; }

    Or is the problem w/ my resource file?  My resource file is server-side, an embedded resource, "Do not copy". 

  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 16 May 2011 Link to this post

    Hi david mcintyre,

    As I mentioned in my earlier post, RadDataFilter does support ShortName. You can check this by assigning a hard-coded string.

    Most probably the problem is connected with your resources.

    Best wishes,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. david mcintyre
    david mcintyre avatar
    31 posts
    Member since:
    Mar 2010

    Posted 16 May 2011 Link to this post

    But I don't want to hardcode it like that, i need a localized version.  Can the filter support this?
Back to Top
DevCraft banner