Is there a way to trigger the edit dialog from within a details panel?
Even a way to select the row would be enough, then i could program the start editing action
Hi Monisha
I have revised my approach to use a command column. However my goal was to have commands trigger from within the details row, thus creating a wider customised toolbar for use with each row as needed. One of those commands would be edit row.
The
SelectRowAsync requires a row index, so i can use the
GetRowIndexByPrimaryKeyAsync to work with your suggestion, Thankyou
|
<SfGrid DataSource="@Employees" @ref="Grid" >
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"></GridEditSettings>
<GridTemplates>
<DetailTemplate>
@{
<SfButton OnClick="@(()=>this.Edit(context as EmployeeData))">Edit</SfButton>
}
</DetailTemplate>
</GridTemplates>
<GridColumns>
...
</GridColumns>
</SfGrid>
@code{
SfGrid<EmployeeData> Grid;
public List<EmployeeData> Employees { get; set; }
public async Task Edit(EmployeeData value)
{
var index = await Grid.GetRowIndexByPrimaryKey(value.EmployeeID);
await Grid.SelectRow(index);
await Task.Delay(100);
await this.Grid.StartEdit();
}
|