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

Validate RadFilter Field Editor

2 Answers 79 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Laura
Top achievements
Rank 1
Laura asked on 16 Feb 2012, 08:26 PM
I am building a radfilter control from code and added field editors like this:

RadFilterTextFieldEditor textFieldEditor13 = new RadFilterTextFieldEditor();
RadFilter1.FieldEditors.Add(textFieldEditor13);
textFieldEditor13.DisplayName = "Display";
textFieldEditor13.FieldName = "Table.Fieldname";

I need to validate the RadFilterTextFieldEditor above (and any other fields I choose) by having the user enter only integer values.  How does one accomplish this?

2 Answers, 1 is accepted

Sort by
0
Accepted
Antonio Stoilkov
Telerik team
answered on 21 Feb 2012, 08:32 AM
Hi Christopher,

You could implement the desired functionality by using RadFilterNumericFieldEditor instead of RadFilterTextFieldEditor as it is shown in the example below.
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        RadFilterNumericFieldEditor textFieldNumericEditpr = new RadFilterNumericFieldEditor();
        RadFilter1.FieldEditors.Add(textFieldNumericEditpr);
        textFieldNumericEditpr.FieldName = "FieldName";
        textFieldNumericEditpr.DataType = typeof(int);
    }
}

Greetings,
Antonio Stoilkov
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
Laura
Top achievements
Rank 1
answered on 21 Feb 2012, 03:20 PM
Thanks, that what I ended up doing.
Tags
Filter
Asked by
Laura
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Laura
Top achievements
Rank 1
Share this question
or