Click here to Skip to main content
16,012,168 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
here how can i insert the webcontrol table with in a tablecell of Main table
Posted
Comments
AswinKrishnan 24-Oct-11 2:31am    
Can you be more specific of your scenario ?

You can always dynamically add the webcontrol in runtime to your cell based on conditions. and if you are using repeater like databinder's you can take advantage of ItemDataBound event.

try to give the target cell an ID (for example
C#
ID=TargetCell
) and set
C#
runat="server"
in its attributes.

then load the user control into it :

C#
TargetCell.Controls.Add(Page.LoadControl("usercontrol1.ascx"));
 
Share this answer
 
Comments
sandhya.T 2011 24-Oct-11 2:43am    
actually i didn't use the .ascx pages
if i use the targetcell id
targetcell.Control.Add(webcontrolid);
table1.Controls.Add(targetcell);
here should i add the stmt as MainTable.Controls.Add(table1);
if i added this one im getting an error as a table cannot be a table child
Amir Mahfoozi 24-Oct-11 2:49am    
You should add table1 to one of MainTable cells, Not to the MainTable itself.
I think if you name one of TDs of MainTable and Add(table1) to it , you will probably do not get this error.
sandhya.T 2011 24-Oct-11 3:07am    
k now i got it
Thanq so much
you need to make
after this in code behind you will have to access this tr and then add HTMLCell into this control
i.e
VB
Dim cell as new HTMLTableCell

after this i think work gonna be clear to you.
just create table now, insert control into the table and table into the cell you just created.
i.e
VB
dim ctrl as MyControl
dim tbl as new HTMLTable
tbl.controls.add(ctrl)
cell.controls.add(tbl)


Hope this will help you :)
 
Share this answer
 
Comments
sandhya.T 2011 24-Oct-11 3:03am    
thanq so much
il try this one

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900