Multiple gridviews in ASP.net web application side by side

Method-1

<div>
<table>
<tr>
<td><asp:GridView ID="GridView1" runat="server"></asp:GridView></td>
<td><asp:GridView ID="GridView2" runat="server"></asp:GridView></td>
</tr>
</table>
</div>

Method-2

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm7.aspx.cs" Inherits="WebApplication16.WebForm7" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
    #leftPanel
    {
        width:300px;
        float:left;
        position:relative;
    }
    #rightPanel
    {
        width:300px;
        float:left;
        position:relative;
    }
</style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="leftPanel">
    <asp:GridView ID="GridView1" runat="server">
    </asp:GridView>
</div>
<div id="rightPanel">
    <asp:GridView ID="GridView2" runat="server">
    </asp:GridView>
</div>
    </form>
</body>
</html>
Ebook Download
View all
Learn
View all