Completed
Last Updated: 15 Aug 2024 12:33 by David
Release 5.1.0 (31 Jan 2024) (R1 2024)
Sreeni
Created on: 17 Apr 2023 07:09
Category: Grid
Type: Bug Report
13
Blazor telerik hierarchy grid collapses on incell editing
Hello,

We have a Blazor Telerik Grid with DetailTemplate. One of the columns in Master/Parent is an editable column. The grid is set with "Incell" for property 'EditMode'.

Issue:-

When the editable column is clicked for editing, the entire grid row(with detail) is collapsed if the row is in expanded mode. Once editing is completed, the grid goes back to its previous state(expanded).

Editing parent column in collapsed mode, works without any issues.

Would like to know if I can keep the grid row in expanded mode while editing(ie. keep the  original state) if its in expanded state.

If not, is it the default behavior of hierarchy grid and how can it be overridden?

Note - Tried with OnEdit and OnRowClick events, but the collapse happens before the respective event handler call.

Thanks in advance !

Sreeni
6 comments
David
Posted on: 15 Aug 2024 12:33

Hi Hristian,

 

Thanks again for the rapid response and detailed information on the Blazor Framework!

 

Regards,

David

ADMIN
Hristian Stefanov
Posted on: 15 Aug 2024 12:30

Hi David,

I'm glad to hear that you achieved the desired behavior in your project.

The need for overriding Equals and GetHashCode comes from how the Blazor framework works. Essentially, the expanded rows collection is matched against the Grid's data collection to determine which rows to expand. By default, the framework compares objects by reference, so when the Grid data is refreshed (like after an edit), the objects in ExpandedItems might not match the refreshed items because they’re new instances. To keep the expansion consistent, it’s necessary to override the Equals method in the model.

This requirement is also mentioned in other parts of our documentation, like in "Expand Rows From Code."

Regards,
Hristian Stefanov
Progress Telerik

Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024

David
Posted on: 15 Aug 2024 11:57

Hi Hristian,

Thanks for the quick reply!  We were able to augment the Parent Grid Dto Model and achieve the desired edit behavior with the Child Grid remaining expanded.  Are there any plans to provide this support without requiring modifications to the Parent Grid Data Model?

 

Regards,

David

ADMIN
Hristian Stefanov
Posted on: 15 Aug 2024 08:07

Hi all,

I confirm that this bug has already been fixed as of version 5.1.0.

Here is a runnable sample for demonstration: REPL link. Please run and test it to see the result.

//Note: To ensure the state is correctly persisted upon editing, override the Equals method together with the GetHashCode of your parent Grid's model as shown in the above REPL sample.

Regards,
Hristian Stefanov
Progress Telerik

Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024

Jim
Posted on: 15 Aug 2024 07:52
I desperately wish that I could use the grid, but this problem has prevented me for years. PLEASE fix this!!
David
Posted on: 14 Aug 2024 21:07

Hi,

 

This issue is still present in Telerik.UI.for.Blazor 6.1.0, are there plans to correct the automatic collapse during Incell Grid editing?

 

Regards,

David