DataGrid Self-Reference Hierarchy space bug #550

Closed
opened 2026-01-29 17:39:09 +00:00 by claunia · 4 comments
Owner

Originally created by @anton-dot on GitHub (Sep 24, 2022).

Describe the bug
Open several items at the same level of heirarhy (let it be first level) and you'll notice, that lower items at second level of items at the same level will be handled as thirs, fourth and so on. If you close first item - it will return to ok.

To Reproduce
Steps to reproduce the behavior:

  1. Create tree with several expanded items
  2. Expan all items
  3. notice, that space of child items is calculated of their heirarhy and counts of already opened items

Expected behavior
A left space of child items are calculated based on their heirarhy level, not already opened items

image

Originally created by @anton-dot on GitHub (Sep 24, 2022). **Describe the bug** Open several items at the same level of heirarhy (let it be first level) and you'll notice, that lower items at second level of items at the same level will be handled as thirs, fourth and so on. If you close first item - it will return to ok. **To Reproduce** Steps to reproduce the behavior: 1. Create tree with several expanded items 2. Expan all items 3. notice, that space of child items is calculated of their heirarhy and counts of already opened items **Expected behavior** A left space of child items are calculated based on their heirarhy level, not already opened items ![image](https://user-images.githubusercontent.com/66353024/192146035-efe21ef0-f333-4d82-a87d-d523eb0a4a5e.png)
Author
Owner

@enchev commented on GitHub (Sep 26, 2022):

I was not able to reproduce this on our demo:
image
Can you share some code?

@enchev commented on GitHub (Sep 26, 2022): I was not able to reproduce this on our demo: ![image](https://user-images.githubusercontent.com/5804953/192211541-a7ad9c3b-b66b-4a86-bd1c-59bc498f1723.png) Can you share some code?
Author
Owner

@anton-dot commented on GitHub (Sep 26, 2022):

Ok, change in online demo to:

<RadzenDataGridColumn TItem="Employee" Title="Employee" Property="LastName" Frozen="true" Sortable="false" Filterable="false" Width="300px">

</RadzenDataGridColumn>

also remove
@ref="grid"

and

void RowRender(RowRenderEventArgs<Employee> args)
    {
        args.Expandable = true;
    }

    void LoadChildData(DataGridLoadChildDataEventArgs<Employee> args)
    {
        args.Data = dbContext.Employees.Where(e => e.ReportsTo == args.Item.EmployeeID || e.ReportsTo == null);
    }

    //protected override async Task OnAfterRenderAsync(bool firstRender)
    //{
    //    base.OnAfterRender(firstRender);

    //    if (firstRender)
    //    {
    //        await grid.ExpandRow(employees.FirstOrDefault());
    //    }
    //}

Click and watch

I think problem occurs while using Property
radzen-blazor-master.zip

@anton-dot commented on GitHub (Sep 26, 2022): Ok, change in online demo to: ``` <RadzenDataGridColumn TItem="Employee" Title="Employee" Property="LastName" Frozen="true" Sortable="false" Filterable="false" Width="300px"> </RadzenDataGridColumn> ``` also remove ` @ref="grid"` and ``` void RowRender(RowRenderEventArgs<Employee> args) { args.Expandable = true; } void LoadChildData(DataGridLoadChildDataEventArgs<Employee> args) { args.Data = dbContext.Employees.Where(e => e.ReportsTo == args.Item.EmployeeID || e.ReportsTo == null); } //protected override async Task OnAfterRenderAsync(bool firstRender) //{ // base.OnAfterRender(firstRender); // if (firstRender) // { // await grid.ExpandRow(employees.FirstOrDefault()); // } //} ``` Click and watch I think problem occurs while using Property [radzen-blazor-master.zip](https://github.com/radzenhq/radzen-blazor/files/9645999/radzen-blazor-master.zip)
Author
Owner

@enchev commented on GitHub (Sep 26, 2022):

Well, this is not good example of self-reference hierarchy. In this case same item(s) can be both child and/or parent - I'm afraid that we cannot support such scenario.

@enchev commented on GitHub (Sep 26, 2022): Well, this is not good example of self-reference hierarchy. In this case same item(s) can be both child and/or parent - I'm afraid that we cannot support such scenario.
Author
Owner

@anton-dot commented on GitHub (Sep 26, 2022):

Modified samle and DB
image
radzen-blazor-master_2.zip

@anton-dot commented on GitHub (Sep 26, 2022): Modified samle and DB ![image](https://user-images.githubusercontent.com/66353024/192303725-bed7a596-43eb-47db-8254-27e40125b4fe.png) [radzen-blazor-master_2.zip](https://github.com/radzenhq/radzen-blazor/files/9647140/radzen-blazor-master_2.zip)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#550