Prevent selection of disabled dataitems when using "check all" checkbox in header

2 posts, 0 answers
  1. Grumpwurst
    Grumpwurst avatar
    8 posts
    Member since:
    Jul 2012

    Posted 23 Aug 2012 Link to this post

    I have a situation where I need to only allow the selection of items in a RadTreeList that the user is authorized to select.  I looped through the data and disabled all the dataitems that the user wasn't authorized to access and I thought everything was working fine until I clicked the checkbox in the header that is used to select all items.

    Apparently, it's still marking all the "rows" as selected even though they are disabled.  I'm pretty sure this checkbox is javascript driven and I was able to capture the click via one of the client-side events, but I cannot find documented anywhere a javascript method/property that will allow me to determine if the item is enabled or not.  That way, I could just undo the selection.

    This was fairly straightforward with a treeview control (which I cannot use for this particular data) because it had properties (eg get_enabled) that was accessible for that control, but doesn't appear to be available for RadTreeList

    Any suggestions?  I need a solution quick because this is being raised as a stop-ship defect
  2. Tsvetina
    Tsvetina avatar
    2087 posts

    Posted 28 Aug 2012 Link to this post


    You can handle the OnItemSelecting client event of RadTreeList and check there whether the elements in the TreeListDataItem are disabled. If so, cancel the selection. The mothod and its event args are documented here:

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top