Articles in this section
Category / Section

How to Make an Editable Combo Box Editor in .NET MAUI DataForm (SfDataForm)?

3 mins read

In the Syncfusion® .NET MAUI DataForm (SfDataForm), you can make an editable combo box editor by using the IsEditable property.

 

C#

 

Register the ComboBoxEditor to the DataForm and initiate the GenerateDataFormItem event handler to the OnGenerateDataFormItem event.

 

protected override void OnAttachedTo(ContentPage bindable)
{
    base.OnAttachedTo(bindable);
    this.dataForm = bindable.FindByName<SfDataForm>("dataForm");
    if (dataForm != null)
    {
        dataForm.ItemsSourceProvider = new ItemSourceProvider();
        dataForm.RegisterEditor("Country", DataFormEditorType.ComboBox);
        dataForm.GenerateDataFormItem += OnGenerateDataFormItem;
    }
}

 

C#

Set the IsEditable property of the DataFormComboBoxItem class to true in the OnGenerateDataFormItem event.

 

private void OnGenerateDataFormItem(object sender, GenerateDataFormItemEventArgs e)
{
    if (e.DataFormItem != null && e.DataFormItem.FieldName == "Country" && e.DataFormItem is DataFormComboBoxItem comboBoxItem)
    {
        comboBoxItem.IsEditable = true;
    }
}

 

Output:

 

Editable Combo box editor in .NET MAUI DataForm

 

Conclusion:

 

I hope you enjoyed learning how to make an editable combo box editor in the .NET MAUI DataForm (SfDataForm).

 

Refer to our .NET MAUI DataForm feature tour page for its other groundbreaking feature representations. You can also explore our .NET MAUI DataForm documentation to understand how to present and manipulate data.

 

For current customers, check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI DataForm and other .NET MAUI components.

 

Please let us know in the following comment section if you have any queries or require clarification. Contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied