show or hide DataFormDataField inside a NewItemTemplate

2 posts, 0 answers
  1. KR
    KR avatar
    20 posts
    Member since:
    Apr 2011

    Posted 21 May Link to this post


    I have a Gender DataFormComboBoxField in the RadDataForm's NewItemTemplate. How do I show and hide another DataFormDataField on the same template(NewItemTemplate) based on the Gender type (male/female)?



  2. Dinko
    Dinko avatar
    914 posts

    Posted 24 May Link to this post

    Hello KR,

    What you can do to achieve this behavior is to bind the Visibility property of the desired DataFormDataField to the Gender property. Then you can create custom IValueConverter and applied to the binding. Inside the Covert() method you can check the current value and show or hide the field.

    I have created a sample project to demonstrate what I have in mind. You can find it attached to this reply. In this project I have specified custom template for the ReadOnlyTemplateEditTemplateNewItemTemplate properties of the RadDataForm.

    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top