radzen-blazor
radzen-blazor copied to clipboard
RadzenTreeLevel. In Expanded pass the last modified object (uncheck/checked) as parameter
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>
-
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.
-
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:
- Change="OnChange"
- ValueChanged="OnValuChanged"
- 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
Hey @Andrey-2021,
We accept pull requests!