Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Gridview Style reduce width

Posted on 2011-03-02
4
Medium Priority
?
639 Views
Last Modified: 2012-06-27
Hi, I am trying to shrink up my Custom gridview control since it has to many columns.

Can anyone suggest a way to make both gridviews fit on a screen?  right now is almost double the screen resolution...  meabe some css style? or split the gridview?


aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="GridViewWithTextBoxes" Debug="true" %>

<!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 id="Head1" runat="server">
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="style.css" media="screen"/>
<title>DHR Bed Control</title>
         
    <style type="text/css">
        .style2
        {
            color: #579;
            font-size: 13px;
            font-weight: bold;
            margin: 4px;
            text-align: center;
            }
        .style3
        {
            text-align: center;
        }
        .dateFont
        {
            text-align: center;
        }
        .style4
        {
            text-align: left;
        }
        .style5
        {
            width: auto;
            line-height: 20px;
            color: #557799;
            font-size: 12px;
            padding: 5px 6px 0px 6px;
            background-color: #FDFDFD;
            border: 1px solid #efefef;
            text-align: justify;
            height: auto;
            text-decoration: underline;
        }
    </style>
 
</head>


<body>
    <form id="form1" runat="server">
<div class="main">

<h4 class="style3">&nbsp;Doctors Hospital at Renaissance - Bed Control</h4>

<h2><asp:Label ID="dateLabel" runat="server" CssClass="dateFont"></asp:Label></h2>

<div class="topb"></div>

<div class="content">


<!-- News block start -->

<div class="insidebox">
<div class="style2">
    <div class="style4">
    AVAILABLE BEDS

    </div>
    </br>
    <div>
      <asp:gridview ID="Gridview1" runat="server" ShowFooter="True" 
            AutoGenerateColumns="False" onrowcreated="Gridview1_RowCreated" 
            EnableModelValidation="True">
            
            <Columns>
         
            <asp:BoundField DataField="RowNumber" HeaderText="Row Number" />
            <asp:TemplateField >
               <HeaderTemplate  >
               <asp:Label runat="server">NT-1</asp:Label>
            
            <asp:TextBox ID="txt_Census1" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>


                <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed1" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment1" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
            </asp:TemplateField>


            <asp:TemplateField >
            <HeaderTemplate  >
               <asp:Label ID="Label2" runat="server">NT-2</asp:Label>
            
            <asp:TextBox ID="txt_Census2" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

                 <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed2" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment2" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
            </asp:TemplateField>


            <asp:TemplateField >
            <HeaderTemplate  >
               <asp:Label ID="Label3" runat="server">NT-3</asp:Label>
            
            <asp:TextBox ID="txt_Census3" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
                 <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed3" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment3" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField >
            <HeaderTemplate  >
            <asp:Label ID="Label4" runat="server">ICU</asp:Label>
            <asp:TextBox ID="txt_Census4" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
                 
             <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed4" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment4" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
              </asp:TemplateField>


       <asp:TemplateField >
       <HeaderTemplate  >
               <asp:Label ID="Label5" runat="server">SDU</asp:Label>
            
            <asp:TextBox ID="txt_Census5" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

           <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed5" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment5" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
     </asp:TemplateField>


        <asp:TemplateField >

        <HeaderTemplate  >
               <asp:Label ID="Label6" runat="server">Tele 3rd-1</asp:Label>
            
            <asp:TextBox ID="txt_Census6" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

                  <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed6" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment6" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
       </asp:TemplateField>

     <asp:TemplateField >
          <HeaderTemplate  >
               <asp:Label ID="Label7" runat="server">Tele 3rd-2</asp:Label>
            
            <asp:TextBox ID="txt_Census7" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
                
                      <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed7" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment7" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
 </asp:TemplateField>

        <asp:TemplateField >
             <HeaderTemplate  >
               <asp:Label ID="Label8" runat="server">Tele 4th-1</asp:Label>
            
            <asp:TextBox ID="txt_Census8" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
                     <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed8" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment8" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField >
                 <HeaderTemplate  >
               <asp:Label ID="Label9" runat="server">Tele 4th-2</asp:Label>
            
            <asp:TextBox ID="txt_Census9" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

            <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed9" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment9" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
                </asp:TemplateField>


         <asp:TemplateField >
            <HeaderTemplate  >
            <asp:Label ID="Label10" runat="server">Pedi 3th</asp:Label>
            <asp:TextBox ID="txt_Census10" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

            <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed10" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment10" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
        </asp:TemplateField>

        
          <asp:TemplateField >
            <HeaderTemplate  >
            <asp:Label ID="Label11" runat="server">Pedi 4th</asp:Label>
            <asp:TextBox ID="txt_Census11" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

             <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed11" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment11" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
        </asp:TemplateField>


           <asp:TemplateField >
             <HeaderTemplate  >
               <asp:Label ID="Label12" runat="server">PICU/SD</asp:Label>
            
            <asp:TextBox ID="txt_Census12" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

             <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed12" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment12" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
         </asp:TemplateField>


                <asp:TemplateField >
                  <HeaderTemplate  >
               <asp:Label ID="Label13" runat="server">MICU</asp:Label>
            
            <asp:TextBox ID="txt_Census13" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

                  <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed13" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment13" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
          </asp:TemplateField>

                <asp:TemplateField >
                  <HeaderTemplate  >
               <asp:Label ID="Label14" runat="server">ER</asp:Label>
            
            <asp:TextBox ID="txt_Census14" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
            <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed14" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment14" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
        </asp:TemplateField>


                <asp:TemplateField >
                  <HeaderTemplate  >
               <asp:Label ID="Label15" runat="server">CPU</asp:Label>
            
            <asp:TextBox ID="txt_Census15" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
            <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed15" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment15" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
      </asp:TemplateField>


                <asp:TemplateField >
                  <HeaderTemplate  >
               <asp:Label ID="Label16" runat="server">CVOR</asp:Label>
            
            <asp:TextBox ID="txt_Census16" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

          <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed16" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment16" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
      </asp:TemplateField>
      

    <asp:TemplateField >
      <HeaderTemplate  >
               <asp:Label ID="Label17" runat="server">CLOF</asp:Label>
            
            <asp:TextBox ID="txt_Census17" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
              <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed17" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment17" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
                </asp:TemplateField>


                <asp:TemplateField >
                  <HeaderTemplate  >
               <asp:Label ID="Label18" runat="server">CVOR H</asp:Label>
            
            <asp:TextBox ID="txt_Census18" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
              <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed18" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment18" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>

                <FooterStyle HorizontalAlign="Right" />
                <FooterTemplate>
                 <asp:Button ID="ButtonAdd" runat="server" Text="Add New Row" 
                        onclick="ButtonAdd_Click" Width="130px" />
                </FooterTemplate>

                </asp:TemplateField>
            </Columns>
        </asp:gridview>
    </div>
  

<!-- News block end -->

<!-- news block start -->

</div>

<asp:Button ID="Button1" runat="server" Text="Save" onclick="Button1_Click" />
</br>
<div class="style5"><strong>PENDING / POSSIBLE DISCHAGES</strong></div>
</br>
<div>


      <asp:gridview ID="Gridview2" runat="server" ShowFooter="True" 
            AutoGenerateColumns="False" onrowcreated="Gridview2_RowCreated" 
            EnableModelValidation="True">
            
            <Columns>
         
            <asp:BoundField DataField="RowNumber2" HeaderText="Row Number" />
            <asp:TemplateField >
               <HeaderTemplate  >
               <asp:Label runat="server">NT-1</asp:Label>
            
            <asp:TextBox ID="txt_Census19" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>


                <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed19" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment19" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
            </asp:TemplateField>


            <asp:TemplateField >
            <HeaderTemplate  >
               <asp:Label ID="Label20" runat="server">NT-2</asp:Label>
            
            <asp:TextBox ID="txt_Census20" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

                 <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed20" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment20" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
            </asp:TemplateField>


            <asp:TemplateField >
            <HeaderTemplate  >
               <asp:Label ID="Label21" runat="server">NT-3</asp:Label>
            
            <asp:TextBox ID="txt_Census21" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
                 <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed21" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment21" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField >
            <HeaderTemplate  >
            <asp:Label ID="Label22" runat="server">ICU</asp:Label>
            <asp:TextBox ID="txt_Census22" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
                 
             <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed22" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment22" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
              </asp:TemplateField>


       <asp:TemplateField >
       <HeaderTemplate  >
               <asp:Label ID="Label23" runat="server">SDU</asp:Label>
            
            <asp:TextBox ID="txt_Census23" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

           <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed23" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment23" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
     </asp:TemplateField>


        <asp:TemplateField >

        <HeaderTemplate  >
               <asp:Label ID="Label24" runat="server">Tele 3rd-1</asp:Label>
            
            <asp:TextBox ID="txt_Census24" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

                  <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed24" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment24" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
       </asp:TemplateField>

     <asp:TemplateField >
          <HeaderTemplate  >
               <asp:Label ID="Label25" runat="server">Tele 3rd-2</asp:Label>
            
            <asp:TextBox ID="txt_Census25" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
                
                      <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed25" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment25" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
 </asp:TemplateField>

        <asp:TemplateField >
             <HeaderTemplate  >
               <asp:Label ID="Label26" runat="server">Tele 4th-1</asp:Label>
            
            <asp:TextBox ID="txt_Census26" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
                     <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed26" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment26" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField >
                 <HeaderTemplate  >
               <asp:Label ID="Label27" runat="server">Tele 4th-2</asp:Label>
            
            <asp:TextBox ID="txt_Census27" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

            <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed27" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment27" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
                </asp:TemplateField>


         <asp:TemplateField >
            <HeaderTemplate  >
            <asp:Label ID="Label28" runat="server">Pedi 3th</asp:Label>
            <asp:TextBox ID="txt_Census28" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

            <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed28" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment28" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
        </asp:TemplateField>

        
          <asp:TemplateField >
            <HeaderTemplate  >
            <asp:Label ID="Label29" runat="server">Pedi 4th</asp:Label>
            <asp:TextBox ID="txt_Census29" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

             <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed29" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment29" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
        </asp:TemplateField>


           <asp:TemplateField >
             <HeaderTemplate  >
               <asp:Label ID="Label30" runat="server">PICU/SD</asp:Label>
            
            <asp:TextBox ID="txt_Census30" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

             <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed30" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment30" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
         </asp:TemplateField>


                <asp:TemplateField >
                  <HeaderTemplate  >
               <asp:Label ID="Label31" runat="server">MICU</asp:Label>
            
            <asp:TextBox ID="txt_Census31" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

                  <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed31" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment31" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
          </asp:TemplateField>

                <asp:TemplateField >
                  <HeaderTemplate  >
               <asp:Label ID="Label32" runat="server">ER</asp:Label>
            
            <asp:TextBox ID="txt_Census32" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
            <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed32" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment32" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
        </asp:TemplateField>


                <asp:TemplateField >
                  <HeaderTemplate  >
               <asp:Label ID="Label33" runat="server">CPU</asp:Label>
            
            <asp:TextBox ID="txt_Census33" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
            <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed33" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment33" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
      </asp:TemplateField>


                <asp:TemplateField >
                  <HeaderTemplate  >
               <asp:Label ID="Label34" runat="server">CVOR</asp:Label>
            
            <asp:TextBox ID="txt_Census34" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>

          <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed34" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment34" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
      </asp:TemplateField>
      

    <asp:TemplateField >
      <HeaderTemplate  >
               <asp:Label ID="Label35" runat="server">CLOF</asp:Label>
            
            <asp:TextBox ID="txt_Census35" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
              <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed35" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment35" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>
                </asp:TemplateField>


                <asp:TemplateField >
                  <HeaderTemplate  >
               <asp:Label ID="Label36" runat="server">CVOR H</asp:Label>
            
            <asp:TextBox ID="txt_Census36" runat="server" Width="50px" ></asp:TextBox>
            </HeaderTemplate>
              <ItemTemplate>
                    Bed:
                    <asp:TextBox ID="txt_Bed36" runat="server" Width="50px"></asp:TextBox>
                    Status:
                    <asp:DropDownList ID="txt_Comment36" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Assigned</asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>
                                      
                </asp:DropDownList>

                </ItemTemplate>

                <FooterStyle HorizontalAlign="Right" />
                <FooterTemplate>
                 <asp:Button ID="ButtonAdd2" runat="server" Text="Add New Row" 
                        onclick="ButtonAdd2_Click" Width="130px" />
                </FooterTemplate>

                </asp:TemplateField>
            </Columns>
        </asp:gridview>

<br />
</div>
<!-- news block end -->


	</div>


<!-- leave the class="clearer" - no floating on left or right side leave this or if
 you like playing around try to remove it and see what happens :P -->

<div class="clearer"><span>

    <asp:Button ID="Button2" runat="server" Text="Save" onclick="Button2_Click" />

    
    </span></div>

    
       <div style="text-align: left">Behavioral Census:
           <asp:TextBox ID="txtCensusWomens" runat="server" Height="22px" 
               style="text-align: right" Text='<%# Bind("Womens_Census") %>' Width="97px"></asp:TextBox>
           &nbsp;&nbsp;&nbsp;
           Women Census:
           <asp:TextBox ID="txtCensusBehavioral" runat="server" Height="23px" 
               Text='<%# Bind("Behavioral_Census") %>' Width="97px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Rehab Census:
           <asp:TextBox ID="txtCensusREHAB" runat="server" Height="23px" 
               Text='<%# Bind("Rehab_Census") %>' Width="91px"></asp:TextBox>
        </div>

</form>
</body>
</html>





Css

body {
	background: #f4f4f4;
	color: #444;
	font-family: Verdana, Arial, SunSans-Regular, Sans-Serif;
	font-size: 11px;
}

a {color: #005784;}
a:hover {color: #28E;}

.top {
	background-color:#EEE;
	width:auto;
	height:15px;
}

.topb {
	background-color:#EEE;
	width:auto;
	height:5px;
}


.main {
	background: #FFF;
	font-size: 1.2em;
	margin: 0 auto;
	width: 1181px;
	border: 1px solid #DFEEF7;
}

.content {
	float: left;
	margin: 10px 0;
	padding: 0 16px;
	width: 1158px;
	height: 100%;
}

.title
{
  	color:#579;
   	font-size: 13px;
   	font-weight: bold;
	margin: 4px;
}

.date
{
    font-size: 9px;
    margin:3px;
}



h1 {
	font: 17px verdana;
	color: #B0B0B0;
	margin: 5px;
}

h2 {
	font-size:11px;
	color:#787878;
	margin:9px;
    text-align: center;
}

h3 {
	color:#579;
   	font-size: 14px;
	margin-bottom: 4px;
}



h4{font-weight:bold; font-size:1em; color: #1A5471;margin: 5px 5px 5px 0px;}
h4{ font-size: 1.6em;} 



.insidebox
{
    width: auto;
    line-height: 20px;
    color: #555A60;
    font-size: 12px;
    padding: 5px 6px 0px 6px;
    background-color: #FDFDFD;
    border: 1px solid #efefef;
    text-align: justify;
    height: auto;
}


.archive
{
    width:100px;
    line-height: 20px;
    font-size:10px;
    background-color: #f4f1f1;
    border:1px solid #DDDDDD;
    float:left;
    text-align:center;
}



li {list-style: none;}


.navigation {
	float: left;
	text-align:left;
	width: 180px;
	background-color:#f7f7f7;
	border:1px solid #efefef;
	color:#666666;
	font-size: 0.9em;
	margin-top:18px;
	margin-left:10px;
}
.navigation h2 {
	color:#5A5A43;
	font-size: 1.1em;
	line-height: 12px;
	padding-left:8px;
}
.navigation ul {
	padding: 0;
	border-top: 1px solid #DDDDDD;
	margin: 0;
}

.navigation li {border-bottom: 1px solid #EAEADA;}


.navigation li a {
	color: #005784;
	background: #f7f7f7;
	font-size: 1.1em;
	display: block;
	padding: 8px 0 8px 5%;
	text-decoration: none;
	width: 170px;
}

.navigation li a:hover {
	background: #f1f1f1;
	color: #28E;
}

/* no floating allowed on right or left side - leave this */
.clearer {clear: both;}

.footer {
    width: auto;
    line-height: 20px;
    color: #555A60;
    font-size:10px;
    background: #f4f4f4;
    border:1px solid #DDDDDD;
    text-align: center;
    height: auto;
}

Open in new window

0
Comment
Question by:TonyReba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Expert Comment

by:hosneylk
ID: 35023670
can't you set the widths of both gridviews to 50%?
0
 
LVL 9

Author Comment

by:TonyReba
ID: 35023733
Hi, one is below the other. Each has about 24 columns which auto size since there is two texboxes in each sell. So , is there any way to split each and have 4 tables. Or even better add a scroll bar  on gridvuew. No on div..itself
0
 
LVL 13

Accepted Solution

by:
Rahul Agarwal earned 2000 total points
ID: 35023805
You can put the grid view in DIV Tag and set the overflow property in style section of DIV tag true and set the width of div in px say 800px.

eg:

<div style="overflow:scroll; width:800px">

then if your  gridview exceeds the limit of 800px then the horizontal scroll bar comes automatically.

or in place of DIV you will take asp:panel also.
0
 
LVL 9

Author Comment

by:TonyReba
ID: 35023818
I have done already, but ideally i want each gridview to scroll no the entire page, or If I could divide each pn 2 would be perfect,

Is there any way to do that?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question