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

SQL DataBinding

1 Answer 77 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 08 Jun 2014, 10:06 AM
Hi,

I am trying to get a RadTreeView to display some very basic data from a SQL Database.

The data is already filtered from the SQL Server so what ever the SQL Server finds, I want to display it all. There is no sort of Row 1 links with Row 2. They are all unique.
The format of the query is
ID, Date, Description.

What I am trying to do is get the Date displayed in the first node, and when it has been clicked, I would want the Description to be down below it.

I have attached a sample image on how it looks now.

My current code is very basic which is below.

<telerik:RadTreeView runat="server" ID="RadTreeView2" Skin="Metro" DataSourceID="GetNotesTicket" datatextfield="Date">
 
                                          
                                       </telerik:RadTreeView>




I have played around with trying to use DataBindings and Notes. As well as trying to use DataFieldID, DataValueField but still not happening.

I ideally would want to display it in a Template the Description so that the user can edit the data using a RadFormWindow so I would be putting some buttons in there to.

This is the closest example I can find on how I want it to work until I start looking at the button clicks. Link

Any help would be useful.

Thanks,




 












1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 10 Jun 2014, 07:02 AM
Hello Alex,

You should handle the DataFieldID and DataFieldParentID  fields of RadTreeView so that the nodes are generated properly. Please have in mind that the ParentId of the root items (dates in your case) should be Null. You can refer to this help topic where this binding is displayed in details.

As for your second issue you can refer to this help topic where is explained how you can add and edit templates in the code behind.

Hope this information will be helpful.

Regards,
Plamen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TreeView
Asked by
Alex
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or