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

DataFormDataField delimit stringlenght on x chars

1 Answer 55 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Volker
Top achievements
Rank 2
Volker asked on 23 Mar 2012, 07:44 AM

Hy,

can i delimit the inputted string length to 12 chars?

my field in the database had only 12 chars. But i can input more than 12 chars in my DataformDatafield.

If i input more than 12 chars i get an Entity.ValidationError by the submit.

is it not possible to say, that the user can only input 12 characters? i found no property for that...

 here is my definition:

 <telerik:DataFormDataField DataMemberBinding="{Binding mark,Mode=TwoWay}" Label="Mark:"  />

 The field mark hat only 12 chars, what i have to change, that the end user can only input 12 chars?

Volker

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivan Ivanov
Telerik team
answered on 23 Mar 2012, 09:49 AM
Hello Volker,

You can either try finding the TextBox, which is placed in the respective DataFormDataField, in the visual tree and set its MaxLength property, or specify ContentTemplate for the field like this:
<telerik:DataFormDataField ... >
<telerik:DataFormDataField.ContentTemplate>   
<DataTemplate>
<TextBox ... MaxLength="5" />
</DataTemplate>
</telerik:DataFormDataField.ContentTemplate>
</telerik:DataFormDataField ... >
DataFormDataField does not expose such property as it is the base type for the other editor fields types, where such property won't make any sense.

Greetings,
Ivan Ivanov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
DataForm
Asked by
Volker
Top achievements
Rank 2
Answers by
Ivan Ivanov
Telerik team
Share this question
or