Hyper Link On Header

2 posts, 0 answers
  1. shabbir mohammad
    shabbir mohammad avatar
    7 posts
    Member since:
    Jan 2010

    Posted 09 May 2011 Link to this post


    I have a treelist with some auto generated column. The header text of those columns needs to be hyperlinked so that user can click on that and navigate to some other page.

    Currently I am generating 'href'  and assigning it to the header text to achieve this. The problem is that look and feel wise it does not appear as hyper link (i.e. blue color and underlined). When i move the cursor to it the ICON does change into 'hand' and I am able to successfully click and navigate to the destination url.

    How can I force this header text to look and feel like actual hyperlink

  2. Martin
    Martin avatar
    810 posts

    Posted 12 May 2011 Link to this post

    Hello Shabbir,

    Note that when sorting is enabled RadTreeList renders anchor elements that fire its sorting command in its header. That is why the appearance of the anchor elements in the header item is customized by the skin so that they look as basic text.

    To workaround the above specifics you should create the anchor on the ItemCreated event like this:

    protected void RadTreeList1_ItemCreated(object sender, TreeListItemCreatedEventArgs e)
        if (e.Item is TreeListHeaderItem)
            TreeListHeaderItem item = e.Item as TreeListHeaderItem;
            HyperLink link = new HyperLink();
            link.ID = "myLink";
            link.ForeColor = Color.FromArgb(0, 0, 240);
            link.Font.Underline = true;
            link.Text = "MyHeaderText";

    I hope this helps.

    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. DevCraft R3 2016 release webinar banner
Back to Top