RadTreelist -- Itemdatabound

4 posts, 0 answers
  1. Sindu
    Sindu avatar
    46 posts
    Member since:
    Oct 2011

    Posted 07 Nov 2011 Link to this post


    I have iterate an item in the item databound .and set a link  to the particluar text using  the below code ..



    if (e.Item is TreeListDataItem)





    TreeListDataItem item = e.Item as TreeListDataItem;




    "Description"].Text = "<a href=\"#\">" + 0512 + "</a>";


    int j = 0;



    My problem is to  set hyper link for 0512 .I mean an underline is shown below the code 0512.
    But blue colour is not appearing in the  0512 .hyperlinks shows blue colour text normally.
    But here is not display 0512 in blue colour.how is it possible?


  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Nov 2011 Link to this post

    Hello  Sindu,

    You can set color to HyperLink by adding one CssClass.

    protected void RadTreeList1_ItemDataBound(object sender, Telerik.Web.UI.TreeListItemDataBoundEventArgs e)
     if (e.Item is TreeListDataItem)
          TreeListDataItem itm = e.Item as TreeListDataItem;
          itm["ColUniqueName"].Text = " <a href=\"#\">" + 0512 + "</a>";
          itm["ColUniqueName"].CssClass = "hypercolor";

    <style type="text/css">
    .hypercolor a
       color:Blue! important;

  3. DevCraft R3 2016 release webinar banner
  4. praveen kumar
    praveen kumar avatar
    1 posts
    Member since:
    Feb 2016

    Posted 16 Feb Link to this post

    Hi Princy,

    I'm trying to set a downloadable file link to RadTreeList  using  TreeListHyperLinkColumn.For this i tried to access GetDataKeyValue  from following code but im unable access this data key name.

    protected void RadTreeList1_ItemDataBound(object sender, Telerik.Web.UI.TreeListItemDataBoundEventArgs e)
                if (e.Item is TreeListDataItem)
                    TreeListDataItem Item = e.Item as TreeListDataItem;
                    var key = item.GetDataKeyValue("Parent").ToString(); // this part not giving GetDataItemKeyValue

      <telerik:RadTreeList ID="rtlTreeList" runat="server" OnNeedDataSource="rtlTreeList_NeedDataSource" ParentDataKeyNames="ParentID" 
                                                                        AutoGenerateColumns="false" OnItemCreated="rtlAttachments_ItemCreated" OnItemDataBound="RadTreeList1_ItemDataBound">
                                                                            <telerik:TreeListHyperLinkColumn ItemStyle-HorizontalAlign="Left" UniqueName="AttachmentFileName" HeaderStyle-Width="200px" 
                                                                                HeaderText="Attachment Name" DataTextField="AttachmentFileName">
                                                                                 <ItemStyle HorizontalAlign="Left" CssClass="hyperlink"/>
                                                                            <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" ScrollHeight="150"></Scrolling>

    Can you please suggest me a way to how to set download file link for RadTreeList.


  5. Eyup
    Eyup avatar
    2941 posts

    Posted 19 Feb Link to this post

    Hello Praveen,

    You can try using a Template column with a HyperLink, similar to the approach demonstrated in the web site provided here:

    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
Back to Top