Row Selection / CheckBox Column - Select Children

4 posts, 0 answers
  1. Scott
    Scott avatar
    2 posts
    Member since:
    Jan 2020

    Posted 08 Sep 2020 Link to this post

    When using multiple selection in the TreeList... i have the checkbox column as one of the columns and SelectChildren is set to true. The checkbox works great to select its children... but when clicking the row... it only selects the row you click on... and breaks the checkbox select children behavior... i am using 2 way binding for the selected items to preselect certain rows as well..

     

    How can I get the row selection to adhere to the same select children rule of the checkbox column?

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5799 posts

    Posted 09 Sep 2020 Link to this post

    Hi Scott,

    Would it be useful to you if the row selection could be configured to only work through the checkboxes in the select column, and not through a row click, like we have it requested for the grid here?

    At the moment, the only other solution I can suggest is hooking to the SelectedItemsChanged event and recursively adding all the required child items to the collection you get as a parameter before populating the SelectedItems of the treelist.

     

    Regards,
    Marin Bratanov
    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/.

  3. Scott
    Scott avatar
    2 posts
    Member since:
    Jan 2020

    Posted 10 Sep 2020 in reply to Marin Bratanov Link to this post

    Yes what you have linked in the grid sounds good... it would be useful to disable clicking the row to check the checkbox especially if the checkbox is set to select it's children.. .because clicking the row won't select the children... I will try to hookup up the SelectedItemsChanged and do it manually... i just thought I read somewhere that if you are using two-way binding for the selected items, you could not also use the SelectedItemsChanged event...hopefully i just misread that...
  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5799 posts

    Posted 11 Sep 2020 Link to this post

    Hi Scott,

    I made this page where you can Follow the implementation of such a feature: https://feedback.telerik.com/blazor/1484271-select-rows-only-with-checkboxes-clicking-the-rows-to-not-affect-selection.

    As for using two-way bindign and the <Parameter>Changed event - the framework does not allow that, the internal way two-way binding works is to use that event already, so you can't use it a second time. You can read more about the general concept here: https://docs.telerik.com/blazor-ui/getting-started/value-vs-data-binding

     

    Regards,
    Marin Bratanov
    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/.

Back to Top