TreeListSelectColumn allow item selection question

3 posts, 1 answers
  1. Steve
    Steve avatar
    4 posts
    Member since:
    Aug 2015

    Posted 24 Feb 2016 Link to this post

    I'm running the latest build and using server side selection with a TreeListSelectColumn. Markup is below. The server side event SelectedIndexChanged is firing properly and I am using AJAX to update additional controls from the SQL database. Currently the user has to click on the checkbox (i.e. select column) to fire the selected index event and select the item in the tree. I would like to allow the user to click any column in the list to select the item (i.e. checkbox or item text) and fire the selected index event and subsequently the item to be selected.

    Is this possible through a setting? I can't seem to find it. Or is there some custom code I need to add to implement this functionality. Thanks..

    <telerik:RadTreeList ID="radtreeCustomer" runat="server" AutoGenerateColumns="false" AllowMultiItemSelection="false" GridLines="None">
          <telerik:TreeListSelectColumn Display="true" UniqueName="Checked" HeaderStyle-Width="30px"></telerik:TreeListSelectColumn>
          <telerik:TreeListBoundColumn Display="false" UniqueName="Organization_Id" DataField="Organization_Id"></telerik:TreeListBoundColumn>
          <telerik:TreeListBoundColumn Display="false" UniqueName="Parent_Organization_Id" DataField="Parent_Organization_Id"></telerik:TreeListBoundColumn>
          <telerik:TreeListBoundColumn Display="true" UniqueName="Business_Name" DataField="Business_Name"></telerik:TreeListBoundColumn>
  2. Answer
    Viktor Tachev
    Viktor Tachev avatar
    2161 posts

    Posted 26 Feb 2016 Link to this post

    Hi Steve,

    In case you would like to keep using server-side selection and implement the described functionality you need to do the following:

    • set the ClientSettings-AllowPostBackOnItemClick property or the RadTreeList to true
    • handle the OnItemCommand event

    In the event handler you can check if it was initiated by a click and then toggle the selection for the current item:

    protected void RadTreeList1_ItemCommand(object sender, TreeListCommandEventArgs e)
        if (e.CommandName == "ItemClick")
            TreeListDataItem clickedItem = e.Item as TreeListDataItem;
            clickedItem.Selected = !clickedItem.Selected;

    Viktor Tachev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Steve
    Steve avatar
    4 posts
    Member since:
    Aug 2015

    Posted 26 Feb 2016 in reply to Viktor Tachev Link to this post

    Thank you that did it. I'm using the clickedItem.Cells array to determine the key value that was selected.
Back to Top