need helps with Filter and TreeListTemplateColumn

4 posts, 0 answers
  1. zxp
    zxp avatar
    16 posts
    Member since:
    Jul 2010

    Posted 11 Feb 2011 Link to this post

    Hi ,

    I want to use TreeList on a page. I have some questions about the TreeList control.
    1. I want to add a filter for the treelist,just like the filter for RadGrid. How to achieve that?
    2. I put a TemplateColumn in the treelist, and I want to display a hyper link in for a column, as 
    <telerik:radtreelist id="EntityGrid" runat="server" autogeneratecolumns="false" datakeynames="RecordID"
                    parentdatakeynames="ParentID">
                <Columns>
                    <telerik:TreeListTemplateColumn UniqueName="ImageHLColHeader" HeaderText="">
                    <ItemTemplate>
                        <asp:HyperLink ID="imageHLCol" runat="server" NavigateUrl=<%# Eval("NavURL") %> ImageUrl=<%# Eval("NavImageURL") %> ></asp:HyperLink>
                    </ItemTemplate>
                    <HeaderStyle Width="35px" />
                    </telerik:TreeListTemplateColumn>
                </Columns>
                </telerik:radtreelist>

    But the column could not be displayed. It always show empty column in the UI. No  hyperlink is shown up. Seems like the hyperlink is ignored. I even try:
     <ItemTemplate>
                        <%# Eval("RecordID") %>
                    </ItemTemplate>

    But still could not see anything shown up in the UI. What's wrong?

    3. I changed the itemTemplate as
    <asp:HyperLink ID="imageHLCol" runat="server"></asp:HyperLink>
    and I want to set the navigateURL and ImageURL when the event ItemDataBound is triggered. But I could not find the hyperLink control in that event.
    TryCast(e.Item, TreeListDataItem)("ImageHLColHeader").FindControl("imageHLCol") always return nothing. What's wrong? 
    Need urgent help. Thank you very very very much.
  2. zxp
    zxp avatar
    16 posts
    Member since:
    Jul 2010

    Posted 11 Feb 2011 Link to this post

    Any suggestion will be great appreciated.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 16 Feb 2011 Link to this post

    Hello zxp,

    Regarding your first question:

    Unfortunately the RadTreeList control does not support filtering.

    Regarding your second question:
    Could you please try setting the Text property of the HyperLink control and let me know if the issue still exists. For example:
    <telerik:TreeListTemplateColumn UniqueName="ImageHLColHeader" HeaderText="">
                   <ItemTemplate>
                       <asp:HyperLink ID="imageHLCol" runat="server" Text="Link" NavigateUrl=<%# Eval("NavURL") %> ImageUrl=<%# Eval("NavImageURL") %> ></asp:HyperLink>
                   </ItemTemplate>
                   <HeaderStyle Width="35px" />
                   </telerik:TreeListTemplateColumn>

    Regarding your third question:
    Could you please try using the following code snippet and let me know if it helps you:
    Protected Sub RadTreeList1_ItemDataBound(ByVal sender As Object, ByVal e As TreeListItemDataBoundEventArgs)
            If TypeOf (e.Item) Is TreeListDataItem Then
                Dim link As HyperLink = CType(TryCast(e.Item, TreeListDataItem)("ImageHLColHeader").FindControl("imageHLCol"), HyperLink)
            End If
        End Sub

    Looking forward for your reply.

    Kind regards,
    Radoslav
    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.
  5. zxp
    zxp avatar
    16 posts
    Member since:
    Jul 2010

    Posted 21 Feb 2011 Link to this post

    Thanks for your reply. I have changed my code to use Grid.
Back to Top