Hi Vadim,
Thank you for contacting Syncfusion support.
Based on the shared information we have checked your requirement of “Changing the visibility of DataFormItems in runtime based on another field value” and it can be achieved inside PropertyChanged event of DataForm’s DataObject, in PropertyChnaged event handler get the changed property value and based on that you can change the visibility of a DataFormItem. To get a DataFormItem in runtime use ItemManager class DataFormItems method.
Please refer the following code snippet for the same,
|
(dataForm.DataObject as ContactsInfo).PropertyChanged += DataFormBehavior_PropertyChanged;
private void DataFormBehavior_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
var dataobject = sender as ContactsInfo;
if(e.PropertyName == "Password" && dataobject.Password != null)
{
var dataFormItem = dataForm.ItemManager.DataFormItems["ConfirmPassword"];
dataFormItem.IsVisible = true;
}
} |
We have prepared a sample for the same, in our sample we have changed ConfirmPassword field visibility after editing the Password field.
We hope this helps. Please let us know if you have any concern.
Regards,
Karthik Raja A