radzen-blazor icon indicating copy to clipboard operation
radzen-blazor copied to clipboard

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

Open Andrey-2021 opened this issue 1 year ago • 1 comments

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> <RadzenTreeLevel TextProperty="Name" ChildrenProperty="Children" HasChildren="@(x=>((ProductType)x).Children?.Count>0)" Expanded=IHaveCheckedChildren /> </RadzenTree>

  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

Andrey-2021 avatar Nov 20 '23 10:11 Andrey-2021

Hey @Andrey-2021,

We accept pull requests!

enchev avatar Nov 20 '23 13:11 enchev