Duplicated
Last Updated: 14 Sep 2022 13:14 by ADMIN
Jared
Created on: 07 Sep 2022 21:35
Category: UI for Blazor
Type: Feature Request
0
TreeView - Add binding for "IsCheckable" and "IsSelectable"

Hello.

I have a scenario where I need to make some nodes in a TreeView checkable and some not.  It would be nice if there was an "IsCheckable" binding that determines whether a node should render a checkbox or not.

Although I've no use for it yet, the same could be done for "IsSelectable".  

Is there some way to do this already, and I'm just not seeing it?  I'd prefer not to use JavaScript interop, or recreate the checkbox functionality through an ItemTemplate.

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
1 comment
ADMIN
Nadezhda Tacheva
Posted on: 14 Sep 2022 13:14

Hi Jared,

The TreeView will expose an OnItemRender event in a future version of UI for Blazor. You may then handle this event to override the default rendering of the items and hide the checkboxes for the desired nodes. That said, I have marked the current item as a duplicate of the OnItemRender event feature request. I also added your vote to the request to increase its popularity as we take that into consideration when planning the component enhancements. You may as well follow the item to keep in track with the progress of the feature.

As for the selection, you can programmatically control it to allow or forbid the selection of specific nodes based on your business logic. You may handle the SelectedItemsChanged event of the TreeView and only add the items to the SelectedItems collection if you want to allow their selection. Additionally, you may style the non-selectable nodes as needed through the OnItemRender event once available.

I hope you will find the above information useful. Please let us know if any further questions are raised.

Regards,
Nadezhda Tacheva
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.