Link to home
Start Free TrialLog in
Avatar of Hans J.Hau
Hans J.Hau

asked on

How to insert multiple GridViews into a Table in VB Web

I'm in the process of creating a Web page which links to our company database and display data into 2 GridViews. I intend for both of them to be displayed side by side.

I'm using Microsoft Visual Web Developer 2010 Express for this project.

Therefore, I added a table and separated it into 3 columns:

<asp:Table ID="Table3" runat="server" Width = "100%" Font-Bold="True" 
                Font-Names="Arial" Font-Size="Large" BackColor="#B9FFFF" CellPadding="0" 
                CellSpacing="0" Height="18px">

                <asp:TableRow>
                    <asp:TableCell Width = "45%"> Status Time Collector</asp:TableCell>
                    <asp:TableCell Width = "10%"> &nbsp </asp:TableCell>
                    <asp:TableCell Width = "45%"> Actual Quantity Data Collector</asp:TableCell>
                </asp:TableRow>

Open in new window


The result is as follows, (the blue row is the table):
User generated image
I then try to insert the GridView into the table by dragging GridView into the design and move it within my <asp.table> code:

<asp:Table ID="Table3" runat="server" Width = "100%" Font-Bold="True" 
                Font-Names="Arial" Font-Size="Large" BackColor="#B9FFFF" CellPadding="0" 
                CellSpacing="0" Height="18px">

                <asp:TableRow>
                    <asp:TableCell Width = "45%"> Status Time Collector</asp:TableCell>
                    <asp:TableCell Width = "10%"> &nbsp </asp:TableCell>
                    <asp:TableCell Width = "45%"> Actual Quantity Data Collector</asp:TableCell>
                </asp:TableRow>

                <asp:TableRow>
                    <asp:TableCell Width = "45%">
                        <asp:GridView ID="GridView1" runat="server">
                        </asp:GridView>
                    </asp:TableCell>

                    <asp:TableCell Width = "10%"> &nbsp </asp:TableCell>

                    <asp:TableCell Width = "45%">
                        <asp:GridView ID="GridView2" runat="server">
                        </asp:GridView>
                    </asp:TableCell>

                </asp:TableRow>
        </asp:Table>

Open in new window


But nothing appears on the Design view. Does this mean that the implementation didn't work? Or is that how it's supposed to be?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.