Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamically add controls to gridview

Status
Not open for further replies.

blar9

Programmer
Mar 12, 2007
39
US
I have several dynamically created grids that I want to put into another grid so they have a grouping. Below is a sample main grid that I need to add another grid into the itemtemplate.

<asp:GridView ID="gvMain" runat="server" Width="90%">
<Columns>
<asp:TemplateField HeaderText="A">
<ItemTemplate>
</ItemTemplate>
</asp:TemplateField>

<asp:TemplateField HeaderText="B">
<ItemTemplate>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

I have been able to create the colums using:

Dim customField As New TemplateField

customField.ItemTemplate = New GridViewTemplate(DataControlRowType.DataRowaRow, "1")

customField.HeaderTemplate = New GridViewTemplate(DataControlRowType.Header, "HeaderTest")

gvMain.Columns.Add(customField)


After the column is added I can see that it exists with gvMain.columns.count but how do I put a grid or any other control into that column?

Thanks!!!!



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top