We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can not change the editor type and the group at the same time.

Thread ID:

Created:

Updated:

Platform:

Replies:

147493 Sep 12,2019 02:05 PM UTC Sep 13,2019 12:00 PM UTC Xamarin.Forms 2
loading
Tags: SfDataForm
Tung
Asked On September 12, 2019 02:05 PM UTC

Hello,

When using event to customize a DataForm, we can not change the editor type and the group at the same time

in the code example below DataFormItem can not be the MultilineText and belong to Group Details.

Line of code    e.DataFormItem.Editor = "MultilineText";  hide the Details group. It's really strange.


  private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
        {
            if (e.DataFormItem != null)
            {
                if (e.DataFormItem.Name == "Code" || e.DataFormItem.Name == "Name")
                    e.DataFormItem.GroupName = "General";
                else
                {
                    e.DataFormItem.GroupName = "Details";
                    e.DataFormItem.Editor = "MultilineText";
                }
                    
            }
        }

Tung
Replied On September 12, 2019 02:11 PM UTC


Karthikraja Arumugam [Syncfusion]
Replied On September 13, 2019 12:00 PM UTC

Hi Tung, 
 
Thank you for contacting Syncfusion support. 
 
Based on the shared information we have checked the reported issue “Cannot change GroupName and Editor of DataFormItem at same”. If you provide DataFormItem GroupName it will be added into DataFormGroupItems so you need to change editor of DataFormItem inside DataFormGroupItem.   
 
Please refer the following code example for the same, 
  
[C#]      
  
private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e) 
        { 
            if (e.DataFormItem != null) 
            { 
                if (e.DataFormItem.Name == "Code" || e.DataFormItem.Name == "Name") 
                    e.DataFormItem.GroupName = "General"; 
                else 
                { 
                    e.DataFormItem.GroupName = "Details"; 
                } 
 
            } 
            if(e.DataFormGroupItem != null && e.DataFormGroupItem.GroupName == "Details") 
            { 
                foreach (var item in e.DataFormGroupItem.DataFormItems) 
                    (item as DataFormItem).Editor = "MultilineText"; 
            } 
        } 
 
 
We have prepared a sample based on your requirement, please find the sample by the following link. 

Sample link: DataFormGroupItem 
   
We hope this helps. Please let us know, if you need any further assistance. 
  
Regards,
Karthik Raja A 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon