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

show or hide DataFormDataField inside a NewItemTemplate

1 Answer 27 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
KR
Top achievements
Rank 1
Veteran
KR asked on 21 May 2019, 08:03 PM

Hi,

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)?

 

Thanks!

1 Answer, 1 is accepted

Sort by
0
Dinko
Telerik team
answered on 24 May 2019, 11:04 AM
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.

Regards,
Dinko
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.
Tags
DataForm
Asked by
KR
Top achievements
Rank 1
Veteran
Answers by
Dinko
Telerik team
Share this question
or