This is a migrated thread and some comments may be shown as answers.

How to hide data fields

1 Answer 75 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 25 Apr 2012, 03:55 PM
I've got a RadTreeList but it's showing every thing including the ID and ParentID fields. How do I hide them?

Also, it is showing my URL field. How do I set the DataNavigateUrlField property so they work properly?

Thanks!

<telerik:RadTreeList ID="RadTreeList1" runat="server" ParentDataKeyNames="ParentID" DataKeyNames="ID" DataNavigateUrlField="WebAddress">
            <Columns>
            <telerik:TreeListBoundColumn DataField="Title" UniqueName="Title" HeaderText="Title" Visible="False" Display="False"/>
            <telerik:TreeListBoundColumn DataField="WebAddress" UniqueName="WebAddress" HeaderText="" Visible="False" Display="False" />
            <telerik:TreeListBoundColumn DataField="ID" UniqueName="ID" HeaderText="" Visible="False" Display="False" />
            <telerik:TreeListBoundColumn DataField="ParentID" UniqueName="ParentID" HeaderText="" Visible="False" Display="False" />
        </Columns>
</telerik:RadTreeList>

1 Answer, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 27 Apr 2012, 03:01 PM
John:

The reason that all columns are showing, despite setting the visible="false" property on some, is due to the fact that you have not added the AutoGenerateColumns="false" (true by default) to your RadTreeList markup:

<telerik:RadTreeList ID="RadTreeList1" runat="server" OnNeedDataSource="RadTreeList1_NeedDataSource"
    AutoGenerateColumns="false" ParentDataKeyNames="ParentID" AllowMultiItemSelection="true"
    AllowPaging="true" PageSize="4" DataKeyNames="ID" AllowSorting="true">

Also, I'd suggest reviewing this online demo: TreeList/Column Types which demonstrates how to create a hyperlink column that provides navigable URLs.

<telerik:TreeListHyperLinkColumn DataTextFormatString="Bing '{0}'" DataNavigateUrlFields="ProductName"
    UniqueName="SearchProduct" DataNavigateUrlFormatString="http://www.bing.com/search?q={0}&go=&form=QBLH&qs=n&sk=&sc=8-9"
    HeaderText="HyperLink Column" DataTextField="ProductName" HeaderStyle-Width="140px">
</telerik:TreeListHyperLinkColumn>

Hope this helps!
Tags
TreeList
Asked by
John
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Share this question
or