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

RadTreeView data binding problem

4 Answers 256 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Luc Émond
Top achievements
Rank 1
Luc Émond asked on 25 Mar 2011, 02:34 PM
Hi,

I probably missing something put when i try to use the RadTreeView for databinding there nothing showing!
The page is blank
Any idea??

Is there something i am missing or is there a bug?
I try the same thing in code behind with the same result!
Any tips or advise are welcome

Tks in advance

<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        
       <telerik:RadTreeView runat="server" ID="RadTreeView1" DataSourceID="SqlDataSource1"
           DataFieldID="id" DataFieldParentID="parentID" CheckBoxes="true">
           <DataBindings>
               <telerik:RadTreeNodeBinding TextField="Text" />
               <telerik:RadTreeNodeBinding Depth="0" Checkable="false" TextField="Text2" Expanded="true"
                    />
           </DataBindings>
       </telerik:RadTreeView>
        
       
   <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:xxxx%>"
    SelectCommand="uspListRegionEcole" SelectCommandType="StoredProcedure"  />

4 Answers, 1 is accepted

Sort by
0
Luc Émond
Top achievements
Rank 1
answered on 28 Mar 2011, 01:11 PM
0
Veronica
Telerik team
answered on 29 Mar 2011, 09:10 AM
Hello Luc Émond,

I'm glad that you were able to find the solution on your own.

Please let me know if you have further questions.

Greetings,
Veronica Milcheva
the Telerik team
0
Chandrak
Top achievements
Rank 1
answered on 13 Oct 2012, 05:25 PM
Hi, 

I am evaluating latest downloaded Telerik controls. Will be buying them within 1 month or so. My question is for the TreeView data binding.

I am having these fields from SQL database.

STATENAME -> STATECODE
CITYNAME - > CITYCODE
DEVICENAME -> DEVICECODE

Now I want TreeView to bind in such a way that STATENAME becomes parent, CITYNAME becomes Child and DEVICENAME becomes grand Child. Can you please let me know how to do that with properties of the tree control? What if depth goes more?

I also want each CODE to be assigned to each respected field so that when user will select any node using context menu I should get the code of the selected node. 

I am new to Rad controls so please let me know descriptive explanation with code.

Thanks

0
Bozhidar
Telerik team
answered on 16 Oct 2012, 07:35 AM
Hello Chandrak,

Please review the following help articles, which explain in detail how you can bind the TreeView to different types of database tables:
http://www.telerik.com/help/aspnet-ajax/treeview-data-binding-hierarchical.html
http://www.telerik.com/help/aspnet-ajax/treeview-data-binding-node-databound.html
http://www.telerik.com/help/aspnet-ajax/treeview-data-binding-loading-related-tables.html
 
Greetings,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
TreeView
Asked by
Luc Émond
Top achievements
Rank 1
Answers by
Luc Émond
Top achievements
Rank 1
Veronica
Telerik team
Chandrak
Top achievements
Rank 1
Bozhidar
Telerik team
Share this question
or