We help IT Professionals succeed at work.

MS VS-2005 Panel Setting

324 Views
Last Modified: 2013-11-26
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?
Comment
Watch Question

Jai STech Arch

Commented:
can you specify the width like this and see
<table border="1" bordercolor="#ff0000" height="100%" width="100%">
rather than setting the style ?

Author

Commented:
Done,
but panel horizontal scrollbar is still disable
Jai STech Arch

Commented:
what contrl arte you having inside the panel ? is it just TEXT or somecontrols... ?
CERTIFIED EXPERT

Commented:
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">

Author

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
CERTIFIED EXPERT

Commented:
then try this

<table border="1" bordercolor="#ff0000" height="95%" width="95%">

Author

Commented:
No progress If you say I can past all code of my page
CERTIFIED EXPERT

Commented:
ya thats better

Author

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>
CERTIFIED EXPERT

Commented:
<td colspan="7" style="height: 392px; text-align: center;">

remove the hardcoded height: 392px like this
Jai STech Arch

Commented:
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%">
CERTIFIED EXPERT

Commented:
             <asp:GridView  ID="gvData" AutoGenerateColumns ="False" runat="server" Height="50px" Width="328px">

provide height ,width in %
Jai STech Arch

Commented:
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,.,.,
Jai STech Arch

Commented:
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%">

Author

Commented:
No progress
Jai STech Arch

Commented:
change you panel code like this and check
<asp:Panel ID="Panel2" ScrollBars="Both" runat="server" Height="98%" Width="800" BorderColor="Red">
CERTIFIED EXPERT

Commented:

try this
<body style="height: 100%; width=100%">
Jai STech Arch

Commented:
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...

Author

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>
Tech Arch
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.