radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.53k stars 789 forks source link

RadzenTreeLevel. In Expanded pass the last modified object (uncheck/checked) as parameter #1254

Open Andrey-2021 opened 11 months ago

Andrey-2021 commented 11 months ago

Please add parametr in Expanded in RadzenTreeLevel. In Expanded pass the last modified object (uncheck/checked) as parameter.

Is your feature request related to a problem? Please describe. Example:

`<RadzenTree Data=@allProductsTypes AllowCheckBoxes=@true @bind-CheckedValues=CheckedProductTypes>

`

1) When data initializing, it's work good. Method IHaveCheckedChildren return true if current TreeLevel have CHECKED children. The branch is opened. And I see all checked children.

2) But, when I uncheck last child in branch, the branch is clossing, because method IHaveCheckedChildren return false. But I don't wont closing this opend branch!!!!! In method IHaveCheckedChildren I can't check last unchecked object.

this is cannot help: 1) Change="OnChange" 2) ValueChanged="OnValuChanged" 3) Collapse="OnCollapse" because they are called after Expanded=IHaveCheckedChildren

Keeping a copy of the tree and looking for what has changed - is a bad way.

Describe the solution you'd like I want to see in parameter in Expanded=IHaveCheckedChildren last uncheck/checked object, the change that caused the call Expanded=IHaveCheckedChildren. And If it is=null, I will know that the reason for the call Expanded is not uncheck/checked object

Additional context image

enchev commented 11 months ago

Hey @Andrey-2021,

We accept pull requests!