<SfGrid @ref="Grid" DataSource="@Orders" AllowPaging="true" Height="315">
<GridEvents TValue="Order" OnActionBegin="ActionBegin" OnActionComplete="ActionComplete" CommandClicked="CommandClicked"></GridEvents>
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"></GridEditSettings>
. . . . . . . .
</SfGrid>
@code{
SfGrid<Order> Grid { get; set; }
public List<Order> Orders { get; set; }
//boolean variable to check the edit state
public bool isEdit { get; set; }
public async Task CommandClicked(CommandClickEventArgs<Order> Args)
{
if (Args.CommandColumn.Type == CommandButtonType.Edit && isEdit)
{
//to cancel the editing
await Grid.CloseEdit();
}
}
public void ActionComplete(ActionEventArgs<Order> Args)
{
if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Cancel || Args.RequestType == Syncfusion.Blazor.Grids.Action.Save)
{
isEdit = false;
}
}
public void ActionBegin(ActionEventArgs<Order> Args)
{
if(Args.RequestType == Syncfusion.Blazor.Grids.Action.Add || Args.RequestType == Syncfusion.Blazor.Grids.Action.BeginEdit)
{
isEdit = true;
}
} |
Hi Syncfusion,
On clicking off of the edited row, is there a way to either (a) guide the user back to the current edited row via pop up ("Hey, please don't click off. Hit save ..."), or (b) (preferred) IGNORE the clicking off of the edited row?
Also - the proposed feature has been in queue for over a year now. Is there an ETA for when it will be implemented?
Gerald.
Hi Gerald ,
Sorry for the Inconvenience.
We are currently Validating the reported query at our end and we will update the further details within two business days(Aug 17, 2022). Until then we appreciate your patience.
Regards,
Naveen Palanivel
Thanks Naveen.
Just for context - this is an issue with both regular users, and notably, those with accessibility needs. The clicking onto another row is often done by accident during edits when they are navigating the edit row fields. As a result, it is causing issues as they cannot focus on their current record. Thanks Naveen. You guys have a great product and I appreciate the prompt response.
Gerald.
Hi Gerald,
Thank you for your feedback,
As per the requirement, we prepared a sample. When we click the next row of the edit button without clicking save, the previous edit row and focus do not move to that row. Please refer to the attached sample for your reference.
Please get back to us if you need further assistance.
Regards,
Naveen Palanivel
Hi Naveen
The save of the edited row when you click on another row is still a behavior in your sample. This would be an issue for users without good mouse control and have a tendency to click off of the row being edited. Is there a way to prevent the grid from accepting a click input on another row while there is a row is being edited?
Gerald
Hi Gerald ,
Sorry for the Inconvenience.
We are currently Validating the reported query at our end and we will update the further details within two business days(Aug 24, 2022). Until then we appreciate your patience.
Regards,
Naveen Palanivel
Hi Gerald,
We checked your query and we achieved your requirement when you edit the row after clicking any another row by without cliking save button, it does not go to save state . we prepared sample attached in this ticket . please kindly refer the attached sample for your reference
public async Task CommandClicked(CommandClickEventArgs<Order> Args) { if (Args.CommandColumn.Type == CommandButtonType.Edit && Grid.IsEdit) { //prevent default action Args.Cancel = true; //show your custom dialog here }
if (Args.CommandColumn.Type == CommandButtonType.Save && isediting) { Args.Cancel = false; isediting = false;
} }
public void ActionBeginHandler(ActionEventArgs<Order> args) { if(args.RequestType== Syncfusion.Blazor.Grids.Action.Save && isediting ) { args.Cancel = true; isediting = false; }
}
public void Recordclick(RecordClickEventArgs<Order> args) { if (Grid.IsEdit) { isediting = true; } } |
Please get back to us if you need further assistance.
Regards,
Naveen Palanivel
Thanks Naveen - but aside from not saving - will the focus be directed back to the row initially edited, and not the row that was clicked on?
Hi Gerald,
We checked your query and we would like to inform that it is default behavior when we click is made using mouse.
So that when click is made, focus will be moved to clicked element and focus from edited record will be removed
Please get back to us if you need further assistance.
Regards,
Naveen Palanivel
Hi Naveen,
Is there any way to override the default behavior as you described above?
Gerald.
Hi Gerald,
We checked your query and we say sorry to inform like that, it is not possible override the default behavior of mouse click action
Please get back to us if you need further assistance on this.
Regards,
Naveen Palanivel
Hi Naveen,
I noticed in this thread, a reference to this feature request: https://www.syncfusion.com/feedback/23583/need-to-prevent-autosave-in-grid-on-next-row-edit-start
Any idea when this will be implemented?
Gerald.
Hi
Gerald,
Welcome from Syncfusion support.
We would like to inform you that we are unable to include the usability
improvement “Need to prevent autosave in Grid on next row edit start” as promised. At
the planning stage for every release cycle, we review all open features and
identify features for implementation based on specific parameters including
product vision, technological feasibility, and customer interest.
You can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.
https://www.syncfusion.com/feedback/23583/need-to-prevent-autosave-in-grid-on-next-row-edit-start
We do not have an immediate plan
to implement this feature and it will be included in any of our upcoming
releases. Please cast your vote to make it count. So that we will prioritize
the features for every release based on demands and consider the requirement in
our Wishlist.
Please
let us know if you have any concerns.
Regards,
Keerthana.
Thanks Keerthana.
Hi Gerald,
Welcome
Please get back to us if you need further assistance.
Regards,
Naveen Palanivel.