473,715 Members | 6,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Only Data Grid should be scrollable!

Hi,

I have a web page (asp.net, code:c#). I havean html table with text boxes.
Based on the user input , records are displayed in the data grid below it.
Now the datagrid has a large no. of columns. & depending on what the user
enters, the data grid can grow very large. So to avoid scrolling the whole
page, I just want the data grid to be scrollable. For this I used the <div>
tags around the data grid,
<div id="DGMainHolde r"style="OVERFL OW:scroll;WIDTH :960px;HEIGHT:9 00px">
<asp:DataGrid>a ll data grid code here</asp:dataGrid>
</div>

But when I vertically scroll the grid , the grid enters into the html table
with text boxes at the top. Also at the top is an image. I just want to make
the data grid vertically scrollable, so that it doesnt get inside the
controls above it.

My HTML code is:
<form id="Form1" method="post" runat="server">

<asp:image id="Image1" style="Z-INDEX: 102; LEFT: 389px; POSITION:
absolute; TOP: 8px" runat="server"
ImageUrl="file:///C:\Documents and Settings\pmud\M y
Documents\image s\small.jpg"></asp:image><asp: label id="Label1"
style="Z-INDEX: 103; LEFT: 400px; POSITION: absolute; TOP: 119px"
runat="server"
Font-Bold="True" Font-Underline="True " Width="96px">VI EW
LOGS</asp:label><asp: linkbutton id="LinkButton1 " style="Z-INDEX: 104; LEFT:
94px; POSITION: absolute; TOP: 99px"
runat="server" Width="9px" Height="3px">Ho me</asp:linkbutton> </td>

<TABLE id="Table1" style="Z-INDEX: 107; LEFT: 303px; WIDTH: 305px;
POSITION: absolute; TOP: 148px; HEIGHT: 91px"
cellSpacing="1" cellPadding="1" width="305" border="1">
<TR>
<TD style="WIDTH: 126px; HEIGHT: 25px">
<asp:label id="lblCompany " runat="server" Font-Bold="True"
Width="117px" Height="5px">Co mpany Name</asp:label></TD>
<TD style="HEIGHT: 25px">
<asp:textbox id="txtCompany " runat="server" Width="139px"
Height="24px"></asp:textbox></TD>
</TR>
<TR>
<TD style="WIDTH: 126px; HEIGHT: 27px">
<asp:label id="lblMonth" runat="server" Font-Bold="True"
Width="91px" Height="5px">Mo nth</asp:label></TD>
<TD style="HEIGHT: 27px">
<asp:dropdownli st id="ddlMonth" runat="server" Width="115px"
Height="8px">
<asp:ListItem Value="None">No ne</asp:ListItem>
<asp:ListItem Value="January" >January</asp:ListItem>
<asp:ListItem Value="Feburary ">Feburary</asp:ListItem>
<asp:ListItem Value="March">M arch</asp:ListItem>
<asp:ListItem Value="April">A pril</asp:ListItem>
<asp:ListItem Value="May">May </asp:ListItem>
<asp:ListItem Value="June">Ju ne</asp:ListItem>
<asp:ListItem Value="July">Ju ly</asp:ListItem>
<asp:ListItem Value="August"> August</asp:ListItem>
<asp:ListItem Value="Septembe r">September </asp:ListItem>
<asp:ListItem Value="October" >October</asp:ListItem>
<asp:ListItem Value="November ">November</asp:ListItem>
<asp:ListItem Value="December ">December</asp:ListItem>
</asp:dropdownlis t></TD>
</TR>
<TR>
<TD style="WIDTH: 126px">
<asp:label id="Label2" runat="server" Font-Bold="True" Width="5px"
Height="5px">Ye ar</asp:label></TD>
<TD>
<asp:textbox id="txtYear" runat="server" Width="126px"
Height="25px"></asp:textbox></TD>
</TR>
</TABLE>

<asp:button id="btnSubmit" style="Z-INDEX: 101; LEFT: 397px; POSITION:
absolute; TOP: 261px"
runat="server" Text="Submit"></asp:button></td>
<div id="DGMainHolde r"
style="OVERFLOW :scroll;WIDTH:9 60px;HEIGHT:900 px"><asp:datagr id id=DataGrid1
style="Z-INDEX: 105; LEFT: 0px; POSITION: absolute; TOP: 478px"
runat="server" ForeColor="Blac k" CellPadding="4" BackColor="#CCC CCC"
CellSpacing="2" BorderWidth="3p x" BorderStyle="So lid" BorderColor="#9 99999"
AutoGenerateCol umns="False" DataKeyField="A siOrder#" DataMember="For mFields"
DataSource="<%# dsCompany1 %>">
<FooterStyle BackColor="#CCC CCC"></FooterStyle>
<SelectedItemSt yle Font-Bold="True" ForeColor="Whit e"
BackColor="#000 099"></SelectedItemSty le>
<ItemStyle BackColor="Whit e"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="Whit e"
BackColor="Blac k"></HeaderStyle>
<Columns>
<asp:EditComman dColumn ButtonType="Lin kButton" UpdateText="Upd ate"
CancelText="Can cel" EditText="Edit" ></asp:EditCommand Column>
<asp:BoundColum n DataField="Date " SortExpression= "ActivationDate "
ReadOnly="True" HeaderText="Dat e"
DataFormatStrin g="{0:d}">
<ItemStyle Width="70px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Regi on" SortExpression= "Region"
ReadOnly="True" HeaderText="Reg ion">
<ItemStyle Width="55px"></ItemStyle>
</asp:BoundColumn >
<

<asp:BoundColum n DataField="Comp anyRepID"
SortExpression= "CompanyRep ID" ReadOnly="True" HeaderText="Com pany RepID">
<ItemStyle Width="35px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Acco unt#" SortExpression= "Account#"
ReadOnly="True" HeaderText="Acc ount">
<ItemStyle Width="50px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="User Name" SortExpression= "UserName"
ReadOnly="True" HeaderText="Use r">
<ItemStyle Width="60px"></ItemStyle>
</asp:BoundColumn >

</Columns>
<PagerStyle HorizontalAlign ="Left" ForeColor="Blac k"
BackColor="#CCC CCC" Mode="NumericPa ges"></PagerStyle>
</asp:datagrid></div>
</body>
</form>

--
pmud
Nov 19 '05 #1
3 2218

not sure if this will help but the following is what i use to have a
vertical only scroll in my page..it's basically a datagrid inside a
div, which is inside another div:

<DIV id="divLog" style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT:
0px; BORDER-TOP: black 1px solid; DISPLAY: inline; PADDING-LEFT: 0px;
Z-INDEX: 115; LEFT: 368px; PADDING-BOTTOM: 0px; MARGIN: 0px; OVERFLOW:
auto; BORDER-LEFT: black 1px solid; WIDTH: 401px; PADDING-TOP: 0px;
BORDER-BOTTOM: black 1px solid; POSITION: absolute; TOP: 544px;
HEIGHT: 116px; BACKGROUND-COLOR: #d8e1ea; TEXT-ALIGN: center"
ms_positioning= "FlowLayout ">
<div id="divLogmid" style="MARGIN-TOP: 2px; MARGIN-LEFT: 2px;
MARGIN-RIGHT: 2px"><b>Contac t
Log</b> | New Contact</font><br>
<br>
<asp:datagrid id="dgLog" style="Z-INDEX: 118" runat="server"
BackColor="#D8E 1EA" EnableViewState ="false"
HeaderStyle-BackColor="#ccc ccc"
AutoGenerateCol umns="false" GridLines="None " Width="373px"
BorderStyle="No ne">
<Columns>
<asp:BoundColum n DataField="Date " HeaderText="Dat e">
<ItemStyle Width="85px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Pers on" HeaderText="Rep ">
<ItemStyle Width="85px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Resu lt"
HeaderText="Res ult">
<ItemStyle Width="100px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Comm ent"
HeaderText="Com ment">
<ItemStyle Width="100px"></ItemStyle>
</asp:BoundColumn >
</Columns>
</asp:datagrid>
</div>
</DIV>
On Wed, 26 Jan 2005 07:31:14 -0800, "=?Utf-8?B?cG11ZA==?="
<pm**@discussio ns.microsoft.co m> wrote:
Hi,

I have a web page (asp.net, code:c#). I havean html table with text boxes.
Based on the user input , records are displayed in the data grid below it.
Now the datagrid has a large no. of columns. & depending on what the user
enters, the data grid can grow very large. So to avoid scrolling the whole
page, I just want the data grid to be scrollable. For this I used the <div>
tags around the data grid,
<div id="DGMainHolde r"style="OVERFL OW:scroll;WIDTH :960px;HEIGHT:9 00px">
<asp:DataGrid>a ll data grid code here</asp:dataGrid>
</div>

But when I vertically scroll the grid , the grid enters into the html table
with text boxes at the top. Also at the top is an image. I just want to make
the data grid vertically scrollable, so that it doesnt get inside the
controls above it.

My HTML code is:
<form id="Form1" method="post" runat="server">

<asp:image id="Image1" style="Z-INDEX: 102; LEFT: 389px; POSITION:
absolute; TOP: 8px" runat="server"
ImageUrl="file:///C:\Documents and Settings\pmud\M y
Documents\imag es\small.jpg"></asp:image><asp: label id="Label1"
style="Z-INDEX: 103; LEFT: 400px; POSITION: absolute; TOP: 119px"
runat="serve r"
Font-Bold="True" Font-Underline="True " Width="96px">VI EW
LOGS</asp:label><asp: linkbutton id="LinkButton1 " style="Z-INDEX: 104; LEFT:
94px; POSITION: absolute; TOP: 99px"
runat="server" Width="9px" Height="3px">Ho me</asp:linkbutton> </td>

<TABLE id="Table1" style="Z-INDEX: 107; LEFT: 303px; WIDTH: 305px;
POSITION: absolute; TOP: 148px; HEIGHT: 91px"
cellSpacing="1" cellPadding="1" width="305" border="1">
<TR>
<TD style="WIDTH: 126px; HEIGHT: 25px">
<asp:label id="lblCompany " runat="server" Font-Bold="True"
Width="117px " Height="5px">Co mpany Name</asp:label></TD>
<TD style="HEIGHT: 25px">
<asp:textbox id="txtCompany " runat="server" Width="139px"
Height="24px"> </asp:textbox></TD>
</TR>
<TR>
<TD style="WIDTH: 126px; HEIGHT: 27px">
<asp:label id="lblMonth" runat="server" Font-Bold="True"
Width="91px" Height="5px">Mo nth</asp:label></TD>
<TD style="HEIGHT: 27px">
<asp:dropdownli st id="ddlMonth" runat="server" Width="115px"
Height="8px" >
<asp:ListItem Value="None">No ne</asp:ListItem>
<asp:ListItem Value="January" >January</asp:ListItem>
<asp:ListItem Value="Feburary ">Feburary</asp:ListItem>
<asp:ListItem Value="March">M arch</asp:ListItem>
<asp:ListItem Value="April">A pril</asp:ListItem>
<asp:ListItem Value="May">May </asp:ListItem>
<asp:ListItem Value="June">Ju ne</asp:ListItem>
<asp:ListItem Value="July">Ju ly</asp:ListItem>
<asp:ListItem Value="August"> August</asp:ListItem>
<asp:ListItem Value="Septembe r">September </asp:ListItem>
<asp:ListItem Value="October" >October</asp:ListItem>
<asp:ListItem Value="November ">November</asp:ListItem>
<asp:ListItem Value="December ">December</asp:ListItem>
</asp:dropdownlis t></TD>
</TR>
<TR>
<TD style="WIDTH: 126px">
<asp:label id="Label2" runat="server" Font-Bold="True" Width="5px"
Height="5px">Y ear</asp:label></TD>
<TD>
<asp:textbox id="txtYear" runat="server" Width="126px"
Height="25px"> </asp:textbox></TD>
</TR>
</TABLE>

<asp:button id="btnSubmit" style="Z-INDEX: 101; LEFT: 397px; POSITION:
absolute; TOP: 261px"
runat="server" Text="Submit"></asp:button></td>
<div id="DGMainHolde r"
style="OVERFLO W:scroll;WIDTH: 960px;HEIGHT:90 0px"><asp:datag rid id=DataGrid1
style="Z-INDEX: 105; LEFT: 0px; POSITION: absolute; TOP: 478px"
runat="serve r" ForeColor="Blac k" CellPadding="4" BackColor="#CCC CCC"
CellSpacing="2 " BorderWidth="3p x" BorderStyle="So lid" BorderColor="#9 99999"
AutoGenerateCo lumns="False" DataKeyField="A siOrder#" DataMember="For mFields"
DataSource="<% # dsCompany1 %>">
<FooterStyle BackColor="#CCC CCC"></FooterStyle>
<SelectedItemSt yle Font-Bold="True" ForeColor="Whit e"
BackColor="#00 0099"></SelectedItemSty le>
<ItemStyle BackColor="Whit e"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="Whit e"
BackColor="Bla ck"></HeaderStyle>
<Columns>
<asp:EditComman dColumn ButtonType="Lin kButton" UpdateText="Upd ate"
CancelText="Ca ncel" EditText="Edit" ></asp:EditCommand Column>
<asp:BoundColum n DataField="Date " SortExpression= "ActivationDate "
ReadOnly="True " HeaderText="Dat e"
DataFormatStrin g="{0:d}">
<ItemStyle Width="70px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Regi on" SortExpression= "Region"
ReadOnly="True " HeaderText="Reg ion">
<ItemStyle Width="55px"></ItemStyle>
</asp:BoundColumn >
<

<asp:BoundColum n DataField="Comp anyRepID"
SortExpression ="CompanyRep ID" ReadOnly="True" HeaderText="Com pany RepID">
<ItemStyle Width="35px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Acco unt#" SortExpression= "Account#"
ReadOnly="True " HeaderText="Acc ount">
<ItemStyle Width="50px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="User Name" SortExpression= "UserName"
ReadOnly="True " HeaderText="Use r">
<ItemStyle Width="60px"></ItemStyle>
</asp:BoundColumn >

</Columns>
<PagerStyle HorizontalAlign ="Left" ForeColor="Blac k"
BackColor="#CC CCCC" Mode="NumericPa ges"></PagerStyle>
</asp:datagrid></div>
</body>
</form>

--
pmud


Nov 19 '05 #2
You are using Grid layout all the time. Flow layout usually is a better
option, especially if you are using tables anyway. For your grid just
replace absolute positioning with width:100%. Also set overflow style for
the <div> to auto.

Eliyahu

"pmud" <pm**@discussio ns.microsoft.co m> wrote in message
news:D5******** *************** ***********@mic rosoft.com...
Hi,

I have a web page (asp.net, code:c#). I havean html table with text boxes.
Based on the user input , records are displayed in the data grid below it.
Now the datagrid has a large no. of columns. & depending on what the user
enters, the data grid can grow very large. So to avoid scrolling the whole
page, I just want the data grid to be scrollable. For this I used the <div> tags around the data grid,
<div id="DGMainHolde r"style="OVERFL OW:scroll;WIDTH :960px;HEIGHT:9 00px">
<asp:DataGrid>a ll data grid code here</asp:dataGrid>
</div>

But when I vertically scroll the grid , the grid enters into the html table with text boxes at the top. Also at the top is an image. I just want to make the data grid vertically scrollable, so that it doesnt get inside the
controls above it.

My HTML code is:
<form id="Form1" method="post" runat="server">

<asp:image id="Image1" style="Z-INDEX: 102; LEFT: 389px; POSITION:
absolute; TOP: 8px" runat="server"
ImageUrl="file:///C:\Documents and Settings\pmud\M y
Documents\image s\small.jpg"></asp:image><asp: label id="Label1"
style="Z-INDEX: 103; LEFT: 400px; POSITION: absolute; TOP: 119px"
runat="server"
Font-Bold="True" Font-Underline="True " Width="96px">VI EW
LOGS</asp:label><asp: linkbutton id="LinkButton1 " style="Z-INDEX: 104; LEFT: 94px; POSITION: absolute; TOP: 99px"
runat="server" Width="9px" Height="3px">Ho me</asp:linkbutton> </td>

<TABLE id="Table1" style="Z-INDEX: 107; LEFT: 303px; WIDTH: 305px;
POSITION: absolute; TOP: 148px; HEIGHT: 91px"
cellSpacing="1" cellPadding="1" width="305" border="1">
<TR>
<TD style="WIDTH: 126px; HEIGHT: 25px">
<asp:label id="lblCompany " runat="server" Font-Bold="True"
Width="117px" Height="5px">Co mpany Name</asp:label></TD>
<TD style="HEIGHT: 25px">
<asp:textbox id="txtCompany " runat="server" Width="139px"
Height="24px"></asp:textbox></TD>
</TR>
<TR>
<TD style="WIDTH: 126px; HEIGHT: 27px">
<asp:label id="lblMonth" runat="server" Font-Bold="True"
Width="91px" Height="5px">Mo nth</asp:label></TD>
<TD style="HEIGHT: 27px">
<asp:dropdownli st id="ddlMonth" runat="server" Width="115px"
Height="8px">
<asp:ListItem Value="None">No ne</asp:ListItem>
<asp:ListItem Value="January" >January</asp:ListItem>
<asp:ListItem Value="Feburary ">Feburary</asp:ListItem>
<asp:ListItem Value="March">M arch</asp:ListItem>
<asp:ListItem Value="April">A pril</asp:ListItem>
<asp:ListItem Value="May">May </asp:ListItem>
<asp:ListItem Value="June">Ju ne</asp:ListItem>
<asp:ListItem Value="July">Ju ly</asp:ListItem>
<asp:ListItem Value="August"> August</asp:ListItem>
<asp:ListItem Value="Septembe r">September </asp:ListItem>
<asp:ListItem Value="October" >October</asp:ListItem>
<asp:ListItem Value="November ">November</asp:ListItem>
<asp:ListItem Value="December ">December</asp:ListItem>
</asp:dropdownlis t></TD>
</TR>
<TR>
<TD style="WIDTH: 126px">
<asp:label id="Label2" runat="server" Font-Bold="True" Width="5px"
Height="5px">Ye ar</asp:label></TD>
<TD>
<asp:textbox id="txtYear" runat="server" Width="126px"
Height="25px"></asp:textbox></TD>
</TR>
</TABLE>

<asp:button id="btnSubmit" style="Z-INDEX: 101; LEFT: 397px; POSITION:
absolute; TOP: 261px"
runat="server" Text="Submit"></asp:button></td>
<div id="DGMainHolde r"
style="OVERFLOW :scroll;WIDTH:9 60px;HEIGHT:900 px"><asp:datagr id id=DataGrid1 style="Z-INDEX: 105; LEFT: 0px; POSITION: absolute; TOP: 478px"
runat="server" ForeColor="Blac k" CellPadding="4" BackColor="#CCC CCC"
CellSpacing="2" BorderWidth="3p x" BorderStyle="So lid" BorderColor="#9 99999" AutoGenerateCol umns="False" DataKeyField="A siOrder#" DataMember="For mFields" DataSource="<%# dsCompany1 %>">
<FooterStyle BackColor="#CCC CCC"></FooterStyle>
<SelectedItemSt yle Font-Bold="True" ForeColor="Whit e"
BackColor="#000 099"></SelectedItemSty le>
<ItemStyle BackColor="Whit e"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="Whit e"
BackColor="Blac k"></HeaderStyle>
<Columns>
<asp:EditComman dColumn ButtonType="Lin kButton" UpdateText="Upd ate"
CancelText="Can cel" EditText="Edit" ></asp:EditCommand Column>
<asp:BoundColum n DataField="Date " SortExpression= "ActivationDate "
ReadOnly="True" HeaderText="Dat e"
DataFormatStrin g="{0:d}">
<ItemStyle Width="70px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Regi on" SortExpression= "Region"
ReadOnly="True" HeaderText="Reg ion">
<ItemStyle Width="55px"></ItemStyle>
</asp:BoundColumn >
<

<asp:BoundColum n DataField="Comp anyRepID"
SortExpression= "CompanyRep ID" ReadOnly="True" HeaderText="Com pany RepID">
<ItemStyle Width="35px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Acco unt#" SortExpression= "Account#"
ReadOnly="True" HeaderText="Acc ount">
<ItemStyle Width="50px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="User Name" SortExpression= "UserName"
ReadOnly="True" HeaderText="Use r">
<ItemStyle Width="60px"></ItemStyle>
</asp:BoundColumn >

</Columns>
<PagerStyle HorizontalAlign ="Left" ForeColor="Blac k"
BackColor="#CCC CCC" Mode="NumericPa ges"></PagerStyle>
</asp:datagrid></div>
</body>
</form>

--
pmud

Nov 19 '05 #3
Hi Mortar,

Thanks. You solved my problem. But instead of using 2 <div> tags, i used
only 1 , the 1st one of yours and it qnswered my question.

"Mortar" wrote:

not sure if this will help but the following is what i use to have a
vertical only scroll in my page..it's basically a datagrid inside a
div, which is inside another div:

<DIV id="divLog" style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT:
0px; BORDER-TOP: black 1px solid; DISPLAY: inline; PADDING-LEFT: 0px;
Z-INDEX: 115; LEFT: 368px; PADDING-BOTTOM: 0px; MARGIN: 0px; OVERFLOW:
auto; BORDER-LEFT: black 1px solid; WIDTH: 401px; PADDING-TOP: 0px;
BORDER-BOTTOM: black 1px solid; POSITION: absolute; TOP: 544px;
HEIGHT: 116px; BACKGROUND-COLOR: #d8e1ea; TEXT-ALIGN: center"
ms_positioning= "FlowLayout ">
<div id="divLogmid" style="MARGIN-TOP: 2px; MARGIN-LEFT: 2px;
MARGIN-RIGHT: 2px"><b>Contac t
Log</b> | New Contact</font><br>
<br>
<asp:datagrid id="dgLog" style="Z-INDEX: 118" runat="server"
BackColor="#D8E 1EA" EnableViewState ="false"
HeaderStyle-BackColor="#ccc ccc"
AutoGenerateCol umns="false" GridLines="None " Width="373px"
BorderStyle="No ne">
<Columns>
<asp:BoundColum n DataField="Date " HeaderText="Dat e">
<ItemStyle Width="85px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Pers on" HeaderText="Rep ">
<ItemStyle Width="85px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Resu lt"
HeaderText="Res ult">
<ItemStyle Width="100px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Comm ent"
HeaderText="Com ment">
<ItemStyle Width="100px"></ItemStyle>
</asp:BoundColumn >
</Columns>
</asp:datagrid>
</div>
</DIV>
On Wed, 26 Jan 2005 07:31:14 -0800, "=?Utf-8?B?cG11ZA==?="
<pm**@discussio ns.microsoft.co m> wrote:
Hi,

I have a web page (asp.net, code:c#). I havean html table with text boxes.
Based on the user input , records are displayed in the data grid below it.
Now the datagrid has a large no. of columns. & depending on what the user
enters, the data grid can grow very large. So to avoid scrolling the whole
page, I just want the data grid to be scrollable. For this I used the <div>
tags around the data grid,
<div id="DGMainHolde r"style="OVERFL OW:scroll;WIDTH :960px;HEIGHT:9 00px">
<asp:DataGrid>a ll data grid code here</asp:dataGrid>
</div>

But when I vertically scroll the grid , the grid enters into the html table
with text boxes at the top. Also at the top is an image. I just want to make
the data grid vertically scrollable, so that it doesnt get inside the
controls above it.

My HTML code is:
<form id="Form1" method="post" runat="server">

<asp:image id="Image1" style="Z-INDEX: 102; LEFT: 389px; POSITION:
absolute; TOP: 8px" runat="server"
ImageUrl="file:///C:\Documents and Settings\pmud\M y
Documents\imag es\small.jpg"></asp:image><asp: label id="Label1"
style="Z-INDEX: 103; LEFT: 400px; POSITION: absolute; TOP: 119px"
runat="serve r"
Font-Bold="True" Font-Underline="True " Width="96px">VI EW
LOGS</asp:label><asp: linkbutton id="LinkButton1 " style="Z-INDEX: 104; LEFT:
94px; POSITION: absolute; TOP: 99px"
runat="server" Width="9px" Height="3px">Ho me</asp:linkbutton> </td>

<TABLE id="Table1" style="Z-INDEX: 107; LEFT: 303px; WIDTH: 305px;
POSITION: absolute; TOP: 148px; HEIGHT: 91px"
cellSpacing="1" cellPadding="1" width="305" border="1">
<TR>
<TD style="WIDTH: 126px; HEIGHT: 25px">
<asp:label id="lblCompany " runat="server" Font-Bold="True"
Width="117px " Height="5px">Co mpany Name</asp:label></TD>
<TD style="HEIGHT: 25px">
<asp:textbox id="txtCompany " runat="server" Width="139px"
Height="24px"> </asp:textbox></TD>
</TR>
<TR>
<TD style="WIDTH: 126px; HEIGHT: 27px">
<asp:label id="lblMonth" runat="server" Font-Bold="True"
Width="91px" Height="5px">Mo nth</asp:label></TD>
<TD style="HEIGHT: 27px">
<asp:dropdownli st id="ddlMonth" runat="server" Width="115px"
Height="8px" >
<asp:ListItem Value="None">No ne</asp:ListItem>
<asp:ListItem Value="January" >January</asp:ListItem>
<asp:ListItem Value="Feburary ">Feburary</asp:ListItem>
<asp:ListItem Value="March">M arch</asp:ListItem>
<asp:ListItem Value="April">A pril</asp:ListItem>
<asp:ListItem Value="May">May </asp:ListItem>
<asp:ListItem Value="June">Ju ne</asp:ListItem>
<asp:ListItem Value="July">Ju ly</asp:ListItem>
<asp:ListItem Value="August"> August</asp:ListItem>
<asp:ListItem Value="Septembe r">September </asp:ListItem>
<asp:ListItem Value="October" >October</asp:ListItem>
<asp:ListItem Value="November ">November</asp:ListItem>
<asp:ListItem Value="December ">December</asp:ListItem>
</asp:dropdownlis t></TD>
</TR>
<TR>
<TD style="WIDTH: 126px">
<asp:label id="Label2" runat="server" Font-Bold="True" Width="5px"
Height="5px">Y ear</asp:label></TD>
<TD>
<asp:textbox id="txtYear" runat="server" Width="126px"
Height="25px"> </asp:textbox></TD>
</TR>
</TABLE>

<asp:button id="btnSubmit" style="Z-INDEX: 101; LEFT: 397px; POSITION:
absolute; TOP: 261px"
runat="server" Text="Submit"></asp:button></td>
<div id="DGMainHolde r"
style="OVERFLO W:scroll;WIDTH: 960px;HEIGHT:90 0px"><asp:datag rid id=DataGrid1
style="Z-INDEX: 105; LEFT: 0px; POSITION: absolute; TOP: 478px"
runat="serve r" ForeColor="Blac k" CellPadding="4" BackColor="#CCC CCC"
CellSpacing="2 " BorderWidth="3p x" BorderStyle="So lid" BorderColor="#9 99999"
AutoGenerateCo lumns="False" DataKeyField="A siOrder#" DataMember="For mFields"
DataSource="<% # dsCompany1 %>">
<FooterStyle BackColor="#CCC CCC"></FooterStyle>
<SelectedItemSt yle Font-Bold="True" ForeColor="Whit e"
BackColor="#00 0099"></SelectedItemSty le>
<ItemStyle BackColor="Whit e"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="Whit e"
BackColor="Bla ck"></HeaderStyle>
<Columns>
<asp:EditComman dColumn ButtonType="Lin kButton" UpdateText="Upd ate"
CancelText="Ca ncel" EditText="Edit" ></asp:EditCommand Column>
<asp:BoundColum n DataField="Date " SortExpression= "ActivationDate "
ReadOnly="True " HeaderText="Dat e"
DataFormatStrin g="{0:d}">
<ItemStyle Width="70px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Regi on" SortExpression= "Region"
ReadOnly="True " HeaderText="Reg ion">
<ItemStyle Width="55px"></ItemStyle>
</asp:BoundColumn >
<

<asp:BoundColum n DataField="Comp anyRepID"
SortExpression ="CompanyRep ID" ReadOnly="True" HeaderText="Com pany RepID">
<ItemStyle Width="35px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="Acco unt#" SortExpression= "Account#"
ReadOnly="True " HeaderText="Acc ount">
<ItemStyle Width="50px"></ItemStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="User Name" SortExpression= "UserName"
ReadOnly="True " HeaderText="Use r">
<ItemStyle Width="60px"></ItemStyle>
</asp:BoundColumn >

</Columns>
<PagerStyle HorizontalAlign ="Left" ForeColor="Blac k"
BackColor="#CC CCCC" Mode="NumericPa ges"></PagerStyle>
</asp:datagrid></div>
</body>
</form>

--
pmud


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
11649
by: Matt Kruse | last post by:
This is a typical layout, but I have specific requirements. I'm trying to figure out a) if it's possible to meet the requirements and b) if so, how. +---------------+ | header | +---------------+ | body | | (scrollable) | +---------------+ | footer |
2
1647
by: scott | last post by:
Hi all, Iv got a slight problem with a datagrid and the ability to only display certain things in it. I have a Data grid which is connected to a data table. The data table is connected to a data set which in turn gets its info from
2
252
by: Jim Corey | last post by:
Hello, I've been using the datagrid, but now I need to sort on the columns, and I really want to do this on the client to save performance time. I had a third-party grid I used in ASP that worked great, but it was difficult to work with. So my list of requirements are simply: -- Sort by column (which implies that it'll be scrollable)
8
2405
by: pmud | last post by:
Hi, I have 2 questions: 1. I have an editable data grid with 21 columns. I need to edit only 2 cloumns in this data grid. But when the grid is displayed in Edit mode, all the columns show long text boxes whichmakes the user to SCROLL a lot. I need only these 2 cloumns to be displayed in Edit mode. Is that possible & how? 2. Also, even when the data grid is not displayed in the edit mode, it
1
1307
by: Elhanan | last post by:
hi... i have a scrollable data grid with which is sortable via table control above that datagrid (i took it from an article somwhere).. trouble is i can't seem to set the columns width for the table control to match the ones on datagrid, when i almost did, changing the resolution messed everything up. (i'm % width) is there a way to have the fonts become smaller according to the
1
1196
by: Cristof Falk | last post by:
Is there an easy way to have a scrollable grid where you can lcok top lines or left columns for headings? It seems like you have to purchase this, which we'd rather not do. We're most interested in VS2005, but have some apps in VS.NET 2003. If we need to purchase, any recommendations of controls that match the built-in one best? Thanks!
2
1860
by: Tom | last post by:
I need to display a series of controls (in my case, a custom control) in a grid-like fashion. This means this particular control would be repeated multiple times, arranged in a row/column format. It would also support scrolling, and fixed/scrollable headers/footers. Basically just like a grid control, but has the capability to use a custom control for each cell. I don't think the grid control (nor the True DB Grid .NET control that we...
3
1551
by: Steve | last post by:
is it possible to create a scrollable data grid without using the div command (i've tried this and it doesn't look good in our system). I was using a program called scrollinggrid, but the designers seem to have disappeared.
0
1785
by: sonali | last post by:
I Have A Grid With Drop Down List As Template Column In Scrolling There Is some Problem Code Is As Follows: <style type="text/css"> .gridFixedHeader { background-color:white; position:relative;
0
8823
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9198
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9047
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5967
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4477
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4738
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3175
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2541
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.