maui-404420-data-grid-crud-crud-overview.md
The DevExpress .NET MAUI Suite ships with built-in record view/edit forms and comprehensive API that help you integrate CRUD (Create-Read-Update-Delete) operations into a data-bound DataGridView. These built-in forms automatically generate data editors according to source item properties. You can customize built-in view/edit forms or create custom forms.
The following methods and commands allow you to invoke built-in view/edit forms:
ShowDetailForm / DataGridViewCommands.ShowDetailFormInvokes the built-in form that displays detail information about a row source item with the specified handle.ShowDetailNewItemForm / DataGridViewCommands.ShowDetailNewItemFormInvokes the built-in form that allows you to create a new item, specify its properties and add it to the source.ShowDetailEditForm / DataGridViewCommands.ShowDetailEditFormInvokes the built-in form that allows you to edit an item’s data.
For more information, refer to the following help topic: Invoke CRUD Forms.
The following API members allow you to customize built-in forms and implement custom forms:
DetailFormTemplateSpecifies a custom view form that shows detail information about a source item.DetailNewItemFormTemplateSpecifies a custom edit form that allows you to add a new source item, and customize its options.DetailEditFormTemplateSpecifies a custom edit form that allows you to modify source item data.DetailFormShowingOccurs before a view/edit form appears, and allows you to customize form settings.CreateDetailFormViewModel
Occurs before a form is invoked, and allows you to create data items with your parameters or customize DetailFormViewModel settings. Depending on the customized form type, use a DetailFormViewModel or DetailEditFormViewModel object. The following list contains main view model APIs:
For more information, refer to the following help topic: Customize CRUD Forms.
Handle the ValidateAndSave event to validate input values and commit them to the data source.
If you use the DataFormView component to implement detail forms, you can use its built-in validation mechanisms.
For more information about data validation, refer to the following help topic: Validate and Save Data.
The following API members allow you to remove items from the source:
DataGridView.DeleteRowAccepts a row handle and deletes the corresponding item from the DataGridView.DetailFormViewModelBase.DeleteAsyncDeletes the edited item from the DataGridView.DetailFormViewModelBase.DeleteCommandThe command that deletes the edited item from the DataGridView. See Also
How to Filter Rows in DevExpress Data Grid for .NET MAUI
How to Sort Rows in DevExpress Data Grid for .NET MAUI
How to Group Rows in DevExpress Data Grid for .NET MAUI