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

[Solved] Radtreeview..suggest me better way

3 Answers 102 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
chandu mahi
Top achievements
Rank 1
chandu mahi asked on 09 Oct 2009, 09:32 PM
Match type1 -("My Number")

Hi ..
i am using radtree view in my web page.
 I am adding the nodes manually. I have to bind the No of records for corresponding match. I will be getting the d
ata from stored procedure  for corresponding Match type 1 to Match type 7.
Can i add rad treenode text side by my database Numbers.

Match type1 -("My Number")
Match type1 -("My Number")
Match type2 -("My Number")
Match type3 -("My Number")
Match type4 -("My Number")
Match type5 -("My Number")
Match type6 -("My Number")
Match type7 -("My Number").

Here i am adding Match Type1 as template field. When user clicks on that link it navigates to another page.
How can i do this.

Please give some suggetions.
How can i do ?


<
td width="50%" > 
                    <rad:RadTreeView ID="RadTreeView1" runat="server" DragAndDropBetweenNodes="true" Skin="Vista">  
                     
                     <Nodes> 
                        <rad:RadTreeNode runat="server" Text="Matching Types" Expanded="true">  
                         <Nodes> 
                          <rad:RadTreeNode runat="server" Text="Match Type1" NavigateUrl="../Modules/Search Results.aspx" 
                           ToolTip="click here to see results of this search for  the match type fot this decedent."  > 
                                                     
                          </rad:RadTreeNode> 
                          <rad:RadTreeNode runat="server" Text="Match Type2" NavigateUrl="../Modules/Search Results.aspx" 
                           ToolTip="click here to see results of this search for  the match type fot this decedent." />                         
                          <rad:RadTreeNode runat="server" Text="Match Type3" NavigateUrl="../Modules/Search Results.aspx" 
                           ToolTip="click here to see results of this search for  the match type fot this decedent." /> 
                          <rad:RadTreeNode runat="server" Text="Match Type4" NavigateUrl="../Modules/Search Results.aspx" 
                           ToolTip="click here to see results of this search for  the match type fot this decedent." /> 
                          <rad:RadTreeNode runat="server" Text="Match Type5" NavigateUrl="../Modules/Search Results.aspx" 
                           ToolTip="click here to see results of this search for  the match type fot this decedent." /> 
                          <rad:RadTreeNode runat="server" Text="Match Type6" NavigateUrl="../Modules/Search Results.aspx" 
                           ToolTip="click here to see results of this search for  the match type fot this decedent." /> 
                          <rad:RadTreeNode runat="server" Text="Match Type7" NavigateUrl="../Modules/Search Results.aspx" 
                           ToolTip="click here to see results of this search for  the match type fot this decedent." />                                          
                         </Nodes> 
                        </rad:RadTreeNode>                      
                     </Nodes>                    
                    </rad:RadTreeView> 
                </td> 

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 15 Oct 2009, 06:15 AM
Hello chandu mahi,

I am afraid I did not understand the exact problem here. Can you please elaborate a bit more?

Regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
chandu mahi
Top achievements
Rank 1
answered on 15 Oct 2009, 02:37 PM
Hi Veselin ..
I am using Rad tree view to display in below format..
Matching Types --> 1st Nodes. In this node i have 7 matching types. For this 7Matching types i have specific data. i want to bind specific  data which is coming from database to the below tree.
In design page i am doing in the below way,You can see the code for this page in previouse post..there is no link button. Just discard that line.
  • Matching Types

     . Match Type1
     . Match Type2
     . Match Type3
     . Match Type4
     . Match Type5        
     . Match Type6
     . Match Type7

I will be getting data from database  for 7 matching types below way , I want to bind below data to the above tree for 7 m=atching types.
9
12
34
45
32
3
67

I want to display like below,
  • Matching Types

     . Match Type1(9)
     . Match Type2(12)
     . Match Type3(34)
     . Match Type4(45)
     . Match Type5 (32)       
     . Match Type6(3)
     . Match Type7(67)

When i am looking at Rad treeview  binding data dynamically demos, i can bind the  node types numbers to Matching Types Node.
But i want display in my page with Text Matching Type1("Mynumber")  to Matching Type7("mynumber") .

How can i display with rad treeview  with  the above format??
Can you give me some suggetsions.
please i don't have much time to do it in other way.
Give me some sample code..Thanks in advance.


0
Simon
Telerik team
answered on 23 Oct 2009, 03:58 PM
Hi chandu mahi,

Yes, you could handle the NodeDataBound event and manually format the Text property of Nodes in the required format. Below is a sample code snippet illustrating this:

protected void RadTreeView1_NodeDataBound(object sender, RadTreeNodeEventArgs e)
{
    DataRowView dataRow = e.Node.DataItem as DataRowView;
 
    e.Node.Text = string.Format("{0}({1})", e.Node.Text, dataRow["mynumber"].ToString());
}

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
chandu mahi
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
chandu mahi
Top achievements
Rank 1
Simon
Telerik team
Share this question
or