Flexgrid cancel edit

Posted by: ehh on 1 December 2022, 11:36 pm EST

    • Post Options:
    • Link

    Posted 1 December 2022, 11:36 pm EST

    Im having issues canceling the edit of a cell in the Flexgrid, after updating to dotnet 6.

    Im using the GridCellEditEventArgs.Cancel in a method running on BeginningEdit on the Flexgrid, it was working as intended before updating to dotnet 6.

    Best Regards

    Emil

  • Posted 4 December 2022, 6:01 pm EST

    Hi Emil,

    We are sorry for the inconvenience we are able to replicate the issue at our end. We have forwarded this issue to the concerned team for further investigation with the internal tracking id- C1-5284.

    We will let you know as we get an update on this.

    In the meantime, you may override the AllowEditing method using the CellFactory and you may prevent the editing for specific cells on condition based.

     public class MyCellFactory : GridCellFactory
        {
            public override bool AllowEditing(GridCellRange range)
            {
                if(range.Column == 1)
                {
                    return false;
                }
                return base.AllowEditing(range);
            }
        }

    Regards,

    Manish Gupta

  • Posted 4 December 2022, 9:00 pm EST

    Hello Manish,

    This works perfect for our solution, thanks for the response.

    Best Regards

    Emil

  • Posted 12 March 2023, 2:13 am EST

    Any update on this. When will be a bug fix available?

  • Posted 12 March 2023, 4:12 pm EST

    Hi,

    This issue has been fixed in the Blazor 2022v3 hotfix 6.0.20223.394 build. Please upgrade to the latest build and verify at your end.

    Regards,

    Manish Gupta

  • Posted 12 March 2023, 7:16 pm EST

    Hello,

    I am using the latest build with .NET 7.

    I can confirm that setting cancel=true in ‘SelectionChanging’ does not have any effect. If using ‘CellFactory’ it works as expected.

    Exact behavior:

    If CellFactory is defined then Grid.SelectionChanging is not called

    If CellFactory is not defined then Grid.SelectionChanging is called

    If Grid.SelectionChanging is called and e.Cancel is set to ‘true’, cell is selected anyway

    If CellFactory is used, ‘OnSelectionChanging’ overwritten and e.Cancel is set to ‘true’ then cell is not selected - as expected.

    Thank you

    Daniel

  • Posted 13 March 2023, 7:46 pm EST

    Hi Daniel,

    The original issue was related to BeginningEdit event which has been fixed. But thank you for pointing out the SelectionChanging issue. We are able to replicate the issue at our end and it has been forwarded to the concerned team with the internal tracking id C1-5643.

    We will let you know as we get an update on this.

    Regards,

    Manish Gupta

  • Posted 21 March 2023, 9:36 pm EST

    Hi Daniel,

    This issue has been marked as Bug by the development team and it should be included in the next 2023v1 hotfix release.

    In the meantime, please keep using the CellFactory SelectionChanging.

    Regards,

    Manish Gupta

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels