Using Gridview in aspx.vb (code-behind)

Posted by Tauron Xavenberg on Stack Overflow See other posts from Stack Overflow or by Tauron Xavenberg
Published on 2009-02-09T10:38:38Z Indexed on 2012/11/04 11:03 UTC
Read the original article Hit count: 179

Filed under:
|
|

I need to create a gridview based on 2 different datasources: main and sub-cathegory. And I need to list them like below:

Productinfo
   sub-product 1
   sub-product 2

Productinfo
   sub-product 1
   sub-product 2
   sub-product 3
   sub-product 4

Etc... the thing is that both the "productinfo" and the "sub-product" are dynamic as the number of both can vary, so I would have to create a gridview within a gridview, plus the necessary filters too.

For this reason I thought it was best to do it all in code-behind, but I can't understand how to use the gridview-class in codebehind and bind it so that it actually shows something in the main aspx page.

Basically what I'm asking for is a simple example of how, when you have nothing but <asp:GridView/> in the aspx -page, can you add components to it and show it, from code-behind (vb)?

Thanks.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about gridview