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

Filter parameter display name binding

4 Answers 66 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 23 Jul 2010, 01:44 AM
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.

4 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 23 Jul 2010, 09:09 AM
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
0
david mcintyre
Top achievements
Rank 1
answered on 12 May 2011, 08:32 PM
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". 

0
Rossen Hristov
Telerik team
answered on 16 May 2011, 09:04 AM
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
0
david mcintyre
Top achievements
Rank 1
answered on 16 May 2011, 01:42 PM
But I don't want to hardcode it like that, i need a localized version.  Can the filter support this?
Tags
DataFilter
Asked by
Adam
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
david mcintyre
Top achievements
Rank 1
Share this question
or