[DataGrid] How To Trigger Commit Edit When Clicking Any Part of the Page

1 Answer 47 Views
DataGrid
Nelson
Top achievements
Rank 1
Nelson asked on 25 Apr 2023, 11:22 AM
Hi, I'm developing a MAUI application with use of Telerik DataGrid. My question is how to trigger the CommitEdit command when user clicking any part of the page? Currently, CommitEdit will trigger when clicks any part of the Telerik DataGrid. Thanks

1 Answer, 1 is accepted

Sort by
0
Maria
Telerik team
answered on 28 Apr 2023, 11:26 AM

Hеllo Nelson,

To trigger the CommitEdit command outside the DataGrid control, you have to execute is by using the following code:

private void radbutton_Clicked(object sender, System.EventArgs e)
{
    this.dataGrid.CommandService.ExecuteCommand(DataGridCommandId.CommitEdit, new EditContext(null, ActionTrigger.Programmatic, null));
}

I tested this on a button-click event outside the DataGrid control and the command is executed. I hope this will be of help to achieve the scenario you are looking for. 

Regards,
Maria
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
DataGrid
Asked by
Nelson
Top achievements
Rank 1
Answers by
Maria
Telerik team
Share this question
or