MS VS-2005 Panel Setting

I have a table on form and in one column of table I have panel for showing gridview in panel and set scrollbars="both"

The problem is that vertical scrollbar is working and horizontal scrollbar is disable due to this the browser width automatically expend to screen

Table code:
<table border="1" bordercolor="#ff0000" height="100%" style="width: 100%">

Panel code:
<asp:Panel ID="Panel1" ScrollBars="Both" runat="server" Height="100%" Width="100%" BorderColor="Red">

Please help where i am doing mistake?
MehramAsked:
Who is Participating?
 
Jai SConnect With a Mentor Tech ArchCommented:
change these values
           <tr>
                <td colspan="7" height="22px" width ="100%">
                    Dynamic Logistics International (Pvt) Ltd.,</td>
            </tr>
            <tr>
                <td colspan="7" height="22px" width ="100%">
                    Supreme Fuel Transportation</td>
            </tr>
            <tr>
                <td colspan="7" height ="386px" style="width: 100%">
0
 
Jai STech ArchCommented:
can you specify the width like this and see
<table border="1" bordercolor="#ff0000" height="100%" width="100%">
rather than setting the style ?
0
 
MehramAuthor Commented:
Done,
but panel horizontal scrollbar is still disable
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Jai STech ArchCommented:
what contrl arte you having inside the panel ? is it just TEXT or somecontrols... ?
0
 
Pratima PharandeCommented:
when the scrollbar is disable  are you lost some data because of that ?
Try this

<asp:Panel ID="Panel1" ScrollBars="Both" runat="server" Height="80%" Width="80%" BorderColor="Red">
0
 
MehramAuthor Commented:
jaiganeshsrinivasan:
In panel I have gridview
pratima_mcs
after doing advised changes the scrollbar is enable but the gridview is still expending
I want table should not expend more then screen width
0
 
Pratima PharandeCommented:
then try this

<table border="1" bordercolor="#ff0000" height="95%" width="95%">
0
 
MehramAuthor Commented:
No progress If you say I can past all code of my page
0
 
Pratima PharandeCommented:
ya thats better
0
 
MehramAuthor Commented:
Objective
The table would not expened more then browser

Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Index.aspx.vb" Inherits="_Default" %>

<!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>Supreme Fuel Work</title>
<script language="javascript" type="text/javascript">
<!--

function TABLE1_onclick() {

}

function TABLE1_onclick() {

}

// -->
</script>
</head>

<%--<script language="javascript">

</script>--%>
<body>
    <form id="form1" runat="server">
    <div>
        <%--<table border="1" bordercolor="#ff0000" height="100%" width="100%">--%>
        <table border="1" bordercolor="#ff0000" height="95%" width="95%">
            <tr>
                <td colspan="7" style="color: blue; height: 3px; text-align: center; font-family: 'Bookman Old Style';">
                    Dynamic Logistics International (Pvt) Ltd.,</td>
            </tr>
            <tr>
                <td colspan="7" style="color: blue; height: 7px; text-align: center">
                    Supreme Fuel Transportation</td>
            </tr>
            <tr>
                <td colspan="7" style="height: 392px; text-align: center;">
                    <%--<asp:Panel ID="Panel1" ScrollBars="Both" runat="server" Height="100%" Width="100%" BorderColor="Red">--%>
                    <asp:Panel ID="Panel2" ScrollBars="Both" runat="server" Height="98%" Width="98%" BorderColor="Red">
                       
                   <asp:GridView  ID="gvData" AutoGenerateColumns ="False" runat="server" Height="50px" Width="328px">
                        <Columns>
                        <asp:BoundField DataField ="Product" HeaderText ="Product" ReadOnly= "True">
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField ="OrderNo" HeaderText ="Order #" ReadOnly ="True">
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TrailerNo" HeaderText ="Trailer #" ReadOnly ="True" >
                            <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Qty" HeaderText ="Quantity" ReadOnly ="True">
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Qty15c" HeaderText ="Quantity 15c" ReadOnly ="True">
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:TemplateField  HeaderText ="Load On">
                        <ItemTemplate>
                            <%#PARSEDATE(Eval("LoadOn"))%>
                        </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField ="DespatchedOn" headertext="Dispatched On" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TripNo" HeaderText ="Trip #" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DocNo" HeaderText ="Docs #" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="SealNo" HeaderText ="Seal #" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DriverName" HeaderText ="Driver Name" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="IDCard" HeaderText ="N.I.C #" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="LicenseNo" HeaderText ="License #" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Location" HeaderText ="Destination" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Contractor" HeaderText ="Transport By"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TurkhamArvd" HeaderText ="Turkham Arrived On"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ExmLtrRcvdOn" HeaderText ="Exemption Ltr Rcvd On"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="FormENo" HeaderText ="Form E # "  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="FormELtrRcvdOn" HeaderText ="From E Ltr Rcvd On"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CrossBorderOn" HeaderText ="Cross Border"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ClearanceExp" HeaderText ="Clearance Exp"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DNo" HeaderText ="D #"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DocDispOn" HeaderText ="Doc Dispatched On"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CourierNo" HeaderText ="Courrier #"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Remarks" HeaderText ="Remarks"  ReadOnly ="True"  >
                            <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:HyperLinkField  HeaderText ="Edit" Text ="Edit"  DataNavigateUrlFields ="TrailerNo" DataNavigateUrlFormatString ="detail.aspx?flag={0}"  />
                        <asp:HyperLinkField  HeaderText ="Delete" Text="Delete" DataNavigateUrlFields ="TrailerNo,qty" DataNavigateUrlFormatString ="index.aspx?flag1={0}&amp;ag={1}"  />
                        </Columns>
                    </asp:gridview>
                   
                   </asp:Panel>
                    <%-- <iframe src="Index.aspx" width ="100%" height ="100%" id="fr"></iframe>--%>
                </td>
            </tr>
            <tr>
                <td style="color: blue; height: 22px;" colspan="7">
                    <asp:FileUpload ID="fileUpload" runat="server" BackColor="Menu" BorderColor="ActiveCaption"
                        ForeColor="ActiveCaption" Width="100%"  />
                    </td>
            </tr>
            <tr>
                <td colspan="7" style="color: blue; height: 22px">
                    <asp:Button ID="cmdShowData" runat="server" BorderColor="ActiveCaption" BorderStyle="Solid"
                        ForeColor="Black" Text="Update Shell File" Width="136px" />
                    <asp:Button ID="Button1" runat="server" BorderColor="ActiveCaption" BorderStyle="Solid"
                        ForeColor="Black" Text="Update Cross Border" Width="136px" />
                    <asp:Button ID="cmdDownload" runat="server" BorderColor="ActiveCaption" BorderStyle="Solid"
                        ForeColor="Black" Text="Create Daily Report" Width="136px" />
                    <asp:Button ID="Button2" runat="server" BorderColor="ActiveCaption" BorderStyle="Solid"
                        ForeColor="Black" Text="Create Psw File" Width="136px" />
                    <asp:Button ID="Button3" runat="server" BorderColor="ActiveCaption" BorderStyle="Solid"
                        ForeColor="Black" Text="Create Ins File" Width="136px" /></td>
            </tr>
            <tr>
                <td colspan="7" style="height: 1px">
                    &nbsp;<asp:Label ID="lbFileInfo" runat="server"></asp:Label>
                    <asp:RequiredFieldValidator ID="rFVFileUpload" runat="server" ControlToValidate="fileUpload" ErrorMessage="Please Select File"  /></td>
            </tr>
        </table>
   
    </div>
    </form>
</body>
</html>
0
 
Pratima PharandeCommented:
<td colspan="7" style="height: 392px; text-align: center;">

remove the hardcoded height: 392px like this
0
 
Jai STech ArchCommented:
change thsi to
<asp:GridView  ID="gvData" AutoGenerateColumns ="False" runat="server" Height="50px" Width="328px">
this
<asp:GridView  ID="gvData" AutoGenerateColumns ="False" runat="server" Height="50px" Width="100%">
0
 
Pratima PharandeCommented:
             <asp:GridView  ID="gvData" AutoGenerateColumns ="False" runat="server" Height="50px" Width="328px">

provide height ,width in %
0
 
Jai STech ArchCommented:
you should not use a hardcoded WIDTH or HEIGHT...in your case its the WIDTH in the GRID VIEW that should be giving the problem...
@pratima...only the /HEIGHT is hard code in your reference...it should not be a problem for HORIZNTAL scroll bar,.,.,
0
 
Jai STech ArchCommented:
again the HEIGHT should not matter
its the WIDTH
change thsi to
<asp:GridView  ID="gvData" AutoGenerateColumns ="False" runat="server" Height="50px" Width="328px">
this
<asp:GridView  ID="gvData" AutoGenerateColumns ="False" runat="server" Height="50px" Width="100%">
0
 
MehramAuthor Commented:
No progress
0
 
Jai STech ArchCommented:
change you panel code like this and check
<asp:Panel ID="Panel2" ScrollBars="Both" runat="server" Height="98%" Width="800" BorderColor="Red">
0
 
Pratima PharandeCommented:

try this
<body style="height: 100%; width=100%">
0
 
Jai STech ArchCommented:
the Panel is not accepting percentage values...tht seems to be the problem
using my example is displaying the panel in specific width

setting height and width for BODY tag will not work...the style can be set only when a ATTRIBUTE exists for that tag...
0
 
MehramAuthor Commented:
After doing some changes now its showing me panel on page with both scrollbar but the table width is still expending out of page.

Change code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Index.aspx.vb" Inherits="_Default" %>

<!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">
    <title>Supreme Fuel Work</title>
<script language="javascript" type="text/javascript">
<!--

function TABLE1_onclick() {

}

function TABLE1_onclick() {

}

// -->
</script>
</head>

<%--<script language="javascript">

</script>--%>
<body>
    <form id="form1" runat="server" >
    <div>
        <table border="1" bordercolor="#ff0000" height="100%" width="100%">
            <tr>
                <td colspan="7" height="22px" width ="950px">
                    Dynamic Logistics International (Pvt) Ltd.,</td>
            </tr>
            <tr>
                <td colspan="7" height="22px" width ="950px">
                    Supreme Fuel Transportation</td>
            </tr>
            <tr>
                <td colspan="7" height ="386px" style="width: 950px">
                    <asp:Panel ID="Panel2" ScrollBars="Both" runat="server" Height="98%" Width="98%" BorderColor="Red">
                   <asp:GridView  ID="gvData" AutoGenerateColumns ="False" runat="server" Height="50px" Width="100%">
                   <Columns>
                        <asp:BoundField DataField ="Product" HeaderText ="Product" ReadOnly= "True">
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField ="OrderNo" HeaderText ="Order #" ReadOnly ="True">
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TrailerNo" HeaderText ="Trailer #" ReadOnly ="True" >
                            <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Qty" HeaderText ="Quantity" ReadOnly ="True">
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Qty15c" HeaderText ="Quantity 15c" ReadOnly ="True">
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:TemplateField  HeaderText ="Load On">
                        <ItemTemplate>
                            <%#PARSEDATE(Eval("LoadOn"))%>
                        </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField ="DespatchedOn" headertext="Dispatched On" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TripNo" HeaderText ="Trip #" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DocNo" HeaderText ="Docs #" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="SealNo" HeaderText ="Seal #" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DriverName" HeaderText ="Driver Name" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="IDCard" HeaderText ="N.I.C #" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="LicenseNo" HeaderText ="License #" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Location" HeaderText ="Destination" ReadOnly ="True" >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Contractor" HeaderText ="Transport By"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TurkhamArvd" HeaderText ="Turkham Arrived On"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ExmLtrRcvdOn" HeaderText ="Exemption Ltr Rcvd On"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="FormENo" HeaderText ="Form E # "  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="FormELtrRcvdOn" HeaderText ="From E Ltr Rcvd On"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CrossBorderOn" HeaderText ="Cross Border"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ClearanceExp" HeaderText ="Clearance Exp"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DNo" HeaderText ="D #"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DocDispOn" HeaderText ="Doc Dispatched On"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CourierNo" HeaderText ="Courrier #"  ReadOnly ="True"  >
                        <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Remarks" HeaderText ="Remarks"  ReadOnly ="True"  >
                            <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>
                        <asp:HyperLinkField  HeaderText ="Edit" Text ="Edit"  DataNavigateUrlFields ="TrailerNo" DataNavigateUrlFormatString ="detail.aspx?flag={0}"  />
                        <asp:HyperLinkField  HeaderText ="Delete" Text="Delete" DataNavigateUrlFields ="TrailerNo,qty" DataNavigateUrlFormatString ="index.aspx?flag1={0}&amp;ag={1}"  />
                        </Columns>
                    </asp:gridview>
                   </asp:Panel>
                </td>
            </tr>
            <tr>
                <td colspan="7" height="22px" width ="950px">
                    <asp:FileUpload ID="fileUpload" runat="server" BackColor="Menu" BorderColor="ActiveCaption"
                        ForeColor="ActiveCaption" Width="900px"  />
                    </td>
            </tr>
            <tr>
                <td colspan="7" height="22px" width ="950px">
                    <asp:Button ID="cmdShowData" runat="server" BorderColor="ActiveCaption" BorderStyle="Solid"
                        ForeColor="Black" Text="Update Shell File" Width="136px" />
                    <asp:Button ID="Button1" runat="server" BorderColor="ActiveCaption" BorderStyle="Solid"
                        ForeColor="Black" Text="Update Cross Border" Width="136px" />
                    <asp:Button ID="cmdDownload" runat="server" BorderColor="ActiveCaption" BorderStyle="Solid"
                        ForeColor="Black" Text="Create Daily Report" Width="136px" />
                    <asp:Button ID="Button2" runat="server" BorderColor="ActiveCaption" BorderStyle="Solid"
                        ForeColor="Black" Text="Create Psw File" Width="136px" />
                    <asp:Button ID="Button3" runat="server" BorderColor="ActiveCaption" BorderStyle="Solid"
                        ForeColor="Black" Text="Create Ins File" Width="136px" /></td>
            </tr>
            <tr>
                <td colspan="7" height="22px" width ="950px">
                    <asp:Label ID="lbFileInfo" runat="server"></asp:Label>
                    <asp:RequiredFieldValidator ID="rFVFileUpload" runat="server" ControlToValidate="fileUpload" ErrorMessage="Please Select File"  /></td>
            </tr>
        </table>
   
    </div>
    </form>
</body>
</html>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.