Delete record from Master Details

Hello,

I have been trying to delete a record with RecordDeleting event from FirstLevelNestedGrid but the grid doesn't update. How can I delete in Master Details?


3 Replies 1 reply marked as answer

VS Vijayarasan Sivanandham Syncfusion Team August 26, 2021 06:14 AM UTC

Hi Theofilos,

Thank you for contacting Syncfusion Support.

RecordDeleting event occurs when the record is being deleted from SfDataGrid. You can delete the selected row by pressing the Delete key while enabling the AllowDeleting property in DetailsViewDataGrid. Please refer the below code snippet, 

<syncfusion:SfDataGrid x:Name="dataGrid" 
                                       AutoGenerateColumns="False" 
                                       AutoGenerateRelations="False" 
                                      AddNewRowPosition="Top" 
                                       ItemsSource="{Binding Path=OrdersDetails}" 
                                       NavigationMode="Cell" 
                                       DetailsViewLoading="dataGrid_DetailsViewLoading" 
                                       ShowGroupDropArea="True"> 
            <syncfusion:SfDataGrid.DetailsViewDefinition> 
                <syncfusion:GridViewDefinition RelationalColumn="OrderDetails"> 
                    <syncfusion:GridViewDefinition.DataGrid> 
                        <syncfusion:SfDataGrid x:Name="FirstDetailsViewGrid" AddNewRowPosition="Top" AllowDeleting="True" 
                                        AutoGenerateColumns="True"/> 
                    </syncfusion:GridViewDefinition.DataGrid> 
                </syncfusion:GridViewDefinition> 
            </syncfusion:SfDataGrid.DetailsViewDefinition> 
</syncfusion:SfDataGrid> 
 
Sample Link: https://www.syncfusion.com/downloads/support/forum/168343/ze/Sample496132701

For more information related to Delete row event, please refer the user guide documentation,

UG Link: https://help.syncfusion.com/wpf/datagrid/data-manipulation#delete-row 
For more information related to Defining properties for DetailsViewDataGrid, please refer the user guide documentation,

UG Link: https://help.syncfusion.com/wpf/datagrid/master-details-view#defining-properties-for-detailsviewdatagrid 
 
Please let us know if you have any concerns in this. 

Regards, 
Vijayarasan S 


Marked as answer

DI Dimitris August 26, 2021 08:14 AM UTC

Thank you I had a silly mistake in my project.



VS Vijayarasan Sivanandham Syncfusion Team August 26, 2021 08:16 AM UTC

Hi Theofilos,

Thanks for the update.

We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊.

Regards,
Vijayarasan S

Loader.
Up arrow icon