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

Trouble displaying data with TreeView

2 Answers 94 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Joe Riley
Top achievements
Rank 1
Joe Riley asked on 25 Feb 2011, 05:34 PM

Hoping someone can direct me down the correct path.  Trying to have a Treeview control on a page where users can use the checkbox feature on the fields they would like queried out of the database. 

This is what I have: Category (6 categories)
Group Desc (to many to list)
Friendly Column Name (to many to list)

See attached image of the data that I return from SQL.

I would like
    Category
        Group Desc
            Friendly Name (datatextfield = QualifiedName)

When attempting to get it working I get several different errors.  Currently the error is

These columns don't currently have unique values.


<telerik:radtreeview id="RadTreeView1" runat="server" checkboxes="True" datafieldid="Category"
            datafieldparentid="GroupDescr" datasourceid="SqlDataSource1" datatextfield="FriendlyName" DataValueField="QualifiedName"></telerik:radtreeview>

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 28 Feb 2011, 11:55 AM
Hello Joe,


You are getting this error because a unique identifier must be assigned to the DataFieldID of Treeview. In your case the DataFieldID is 'Category' which is not a unique field in your database. For more information on this please refer the following documentation.
Binding to Hierarchical Data

Hope this information helps,
-Shinu.
0
Joe Riley
Top achievements
Rank 1
answered on 01 Mar 2011, 03:12 PM
Shinu,

Thank you for your response it does help out greatly.

Thanks,
Joe
Tags
TreeView
Asked by
Joe Riley
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Joe Riley
Top achievements
Rank 1
Share this question
or