• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2230
  • Last Modified:

Gridview nested in treeview

I have these small Griviews which are dynamically populated (they have radio button controls) Now I want to nest each of these gridviews in a treeview. How can I do this?

when I try to create a childnode then the treeview is accepting only strings, how can I make it accept a gridview control as a whole instead ?
0
Anushart
Asked:
Anushart
  • 3
  • 3
1 Solution
 
sabeeshCommented:
You can add your node some thing like this

string tab = "<table ><tr><td><span id='ctl00_ContentPlaceHolder1_Label2'>Business :</span></td>";
        tab += "<td > <input name='test' type='text' id='ctl00_ContentPlaceHolder1_txtBusinessName' />";
                        tab += " </td> </tr></table>";
        TreeNode node = new TreeNode(tab);
        TreeView1.Nodes.Add(node);
0
 
AnushartAuthor Commented:
That is a neat idea. I didnt know that before, but when I try to do the same with the gridview it is giving problem as it has  a double quote in it

I already have those gridviews on the page

Now all I need to do is call each gridview below the parent node

So my string should go like

string tab = "<table ><tr><td>---PLACE GRIDVIEW Here ----</td> </tr></table>";
0
 
sabeeshCommented:
You cannot put any aspx control inside only html control you can place. so you have to design such a way that tables with your html control.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
AnushartAuthor Commented:
I am sorry, didnt understand you what do u mean by
"so you have to design such a way that tables with your html control."
0
 
sabeeshCommented:
What i mean is you have to use html control only. So you can design the grid view using tables.

TreeNode n = new TreeNode("TestNode");
        TreeView1.Nodes.Add(n);
        TreeNode n1 = new TreeNode("TestNode");
        TreeView1.Nodes.Add(n1);
        string tab = "<table><tr> <td style='width: 100px'> <input id='Radio1' type='radio' /></td></tr><tr> <td style='width: 100px'> <input id='Radio2' type='radio' /></td></tr><tr> <td style='width: 100px'> <input id='Radio3' type='radio' /></td></tr></table>";
        TreeNode node = new TreeNode(tab);
        TreeView1.Nodes.Add(node);
0
 
AnushartAuthor Commented:
I think I can manage with that code.
But the trouble is while inserting....

Lets say I have 5 radio buttons in a single child node. How will I insert the radio buttons value into database.

Anyway, I really appreciate your effort till now
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now