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

Data Annotations

9 Answers 128 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 05 Oct 2010, 11:43 AM
The Data Annotations topic states that the System.ComponentModel.DataAnnotations.DisplayAttribute attribute can be used to customise how filter fields are displayed. I have attempted to use this attribute in my own data objects but the AutoGenerateFilter and ShortName appear to be ignored by the RadDataFilter control. As it stands there doesn’t appear to be any way to control how the property names are displayed, which makes it hard to see how this control can actually be used in an application. Am I missing something?

9 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 05 Oct 2010, 11:58 AM
Hi Kevin,

That is totally strange. We are pretty sure that these annotations are supported.

Could you please open a separate support ticket and send us the sample project that demonstrates how they do not work. We will then see what is wrong.

Thanks in advance.

Greetings,
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
Kevin
Top achievements
Rank 1
answered on 05 Oct 2010, 01:56 PM
I create a support ticket with a simple project attached to demonstrate the problem but I've also subsequently found (and voted on) the following issue:

Issue ID 3646 - System.ComponentModel.DataAnnotations.DisplayAttribute is not respected by RadDataFilter in WPF 4.0
0
Rossen Hristov
Telerik team
answered on 05 Oct 2010, 02:11 PM
Hello Kevin,

I have just created this issue while answering you, but you are very fast :) :) :).

In fact I wanted to fix the issue and check it in before I sent you the answer.

Anyway, I am currently working on it. When it is resolved it will be indicated in the PITS issue that you have already found.

Thanks.

Greetings,
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
Hristiliyan
Top achievements
Rank 1
answered on 15 Oct 2010, 11:23 AM
I have the same issue , how do you resolve it? 
0
Yordanka
Telerik team
answered on 15 Oct 2010, 12:24 PM
Hello Hristiliyan,

The issue is already fixed in our latest internal build (version .1008). For more information you can check the PITS issue link pointed above.

Greetings,
Yordanka
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
Hristiliyan
Top achievements
Rank 1
answered on 15 Oct 2010, 12:50 PM
So, how do I fix my problem, or I'll have to wait until the next update is released ?
0
Yordanka
Telerik team
answered on 15 Oct 2010, 02:41 PM
Hi Hristiliyan,

You need to download the latest internal build from Your Account ->Free Trials -> RadControls for WPF -> Latest Internal Builds (Trial).

Sincerely yours,
Yordanka
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
Hristiliyan
Top achievements
Rank 1
answered on 17 Oct 2010, 11:07 AM
Oh ... OK :) Thank you, I didn't know about this feature. Thanks a lot, in Monday I'll see if that will do the job.
0
Muhammed
Top achievements
Rank 1
Iron
answered on 22 Apr 2023, 12:59 PM

Data Annotations


Plain text

public class MyModel { [Display(Name = "Custom Name", ShortName = "Short Name")] public string MyProperty { get; set; } }

In this example, the Name property of the DisplayAttribute is set to "Custom Name," and the ShortName property is set to "Short Name." You can then use this model in the RadDataFilter control and the custom names will be displayed in the filter fields:

Plain text

@(Html.Kendo().DataFilter<MyModel>() .Name("myDataFilter") .Filterable(filterable => filterable .Extra(false) .Operators(operators => operators .ForString(str => str.Clear() .Contains("Contains") ) ) ) .DisplayMode(FilterDisplayMode.FilterRow) )

Tags
DataFilter
Asked by
Kevin
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Kevin
Top achievements
Rank 1
Hristiliyan
Top achievements
Rank 1
Yordanka
Telerik team
Muhammed
Top achievements
Rank 1
Iron
Share this question
or