Link to home
Start Free TrialLog in
Avatar of Anushart
AnushartFlag for United States of America

asked on

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 ?
Avatar of sabeesh
sabeesh
Flag of United States of America image

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);
Avatar of Anushart

ASKER

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>";
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.
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."
ASKER CERTIFIED SOLUTION
Avatar of sabeesh
sabeesh
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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