DataForm Validation

6 posts, 1 answers
  1. Thomas
    Thomas avatar
    10 posts
    Member since:
    Sep 2013

    Posted 19 Sep 2013 Link to this post

    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
  2. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 24 Sep 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Thomas
    Thomas avatar
    10 posts
    Member since:
    Sep 2013

    Posted 24 Sep 2013 Link to this post

    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
  5. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 27 Sep 2013 Link to this post

    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 >>
  6. Thomas
    Thomas avatar
    10 posts
    Member since:
    Sep 2013

    Posted 27 Sep 2013 Link to this post

    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
  7. Answer
    Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 01 Oct 2013 Link to this post

    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 >>
Back to Top
UI for WPF is Visual Studio 2017 Ready