Hi A B,
Greetings from Syncfusion support.
We suggest you to use as like the below codes to achieve this requirement. Based on the bool value from OnActionBegin handler use either Normal or Dialog modes. We have also prepared a sample for your convenience, please download the sample from the link below,
Please refer the codes below,
|
<SfGrid @ref="Grid" ...>
<GridEvents OnActionBegin="OnActionBegin" OnActionComplete="OnActionComplete" TValue="Order"></GridEvents>
@if (EditModeSelection)
{
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Dialog"></GridEditSettings>
}
else
{
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Normal"></GridEditSettings>
}
...
</SfGrid>
public bool EditModeSelection { get; set; }
public void OnActionBegin(ActionEventArgs<Order> args)
{
if (args.RequestType.ToString() == "BeginEdit")
{
EditModeSelection = false;
}
else if (args.RequestType.ToString() == "Add")
{
EditModeSelection = true;
}
}
public void OnActionComplete(ActionEventArgs<Order> args)
{
if (args.RequestType.ToString() == "Add" || args.RequestType.ToString() == "BeginEdit")
{
args.PreventRender = false;
}
}
|
Reference :
Please get back to us if you need further assistance.
Regards,
Renjith Singh Rajendran