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

DataForm Validation

5 Answers 169 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 19 Sep 2013, 12:38 PM
Hello everybody,

I have a dataform with some fields declared as nullable double (i.e. double?). When I start my application, it is OK I have empty fields for the nullable parameters. But if I start to fill one of these fields and then I delete what I have written, I cannot let the field empty again. The field is boxed with a red frame and a validation exception disables end edit button.

Do you have an explanation and a method to let my fields empty ? I tried to modify the validation exception but I cannot find where they are defined.

Thank you !

Regards,

Thomas

5 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 24 Sep 2013, 01:44 PM
Hello Thomas,

I would suggest you to check the DataForm's Validation help articles for a reference (Link1, Link2).

Regards,
Yoan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Thomas
Top achievements
Rank 1
answered on 24 Sep 2013, 04:12 PM
Hello Yoan,

Thank you for your answer. I already have read these articles but I still can't manage to let my fields empty. Plus, I don't know how to disable automatic validation control.

Regards,
Thomas
0
Yoan
Telerik team
answered on 27 Sep 2013, 02:02 PM
Hello Thomas,  

In order to achieve your goal, you can try to set the TargetNullValue to string.empty on the Binding. Please check the following code snippet for a reference:

<telerik:DataFormDataField DataMemberBinding="{Binding StadiumCapacity, Mode=TwoWay, TargetNullValue=''}" />

I hope this helps.

Regards,
Yoan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Thomas
Top achievements
Rank 1
answered on 27 Sep 2013, 04:00 PM
Hello Yoan,

Thank you again for your answer. But it doesn't work. I think my explanation was not clear. I have taken some pictures to illustrate my issue. Capture1 represents the state of the dataform when I start edition. Some fields (declare as nullable double in the code) are empty. Then, I type some figures in one field => Capture2. Finally, I delete all these figures to let the field empty, as it was at the beginning. A validation error message occurs and disables me to end editing => Capture3.

Have you an idea to help me to fix this issue ?

Thank you !

Regards,

Thomas
0
Accepted
Yoan
Telerik team
answered on 01 Oct 2013, 05:41 PM
Hi Thomas,

Actually, I have tested the suggested approach in a sample project and everything is working as expected. You can find my test project attached. If I am missing something please let me know.

Regards,
Yoan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
DataForm
Asked by
Thomas
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or