Hi. I'm using vs2008. I have a gridview that is inside of a panel. My problem is that the gridview keeps moving itself out of div into the top of the form area. Here's my code:
<form id="form1" runat="server"
style="background-color: #FFFFFF; height: 770px;">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
borderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3"
DataSourceID="SqlDataSource1" GridLines="Vertical" Height="173px" PageSize="16"
Width="880px" style="font-size: small">
<RowStyle BackColor="#EEEEEE" ForeColor="Black" />
<Columns>
<asp:CommandField ShowSelectButton="True" >
<ItemStyle Width="65px" />
</asp:CommandField>
<asp:BoundField DataField="RecDate"
DataFormatString="{0:MM/dd/yyyy}" HeaderText="RecDate" SortExpression="RecDate">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="PurchaseOrder"
DataFormatString="{0:g}" HeaderText="PO NO."
SortExpression="PurchaseOrder">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="ProductID" HeaderText="ProductID"
SortExpression="ProductID" >
<ItemStyle Width="75px" />
</asp:BoundField>
<asp:BoundField DataField="description"
HeaderText="Description" SortExpression="description">
<ItemStyle Width="300px" />
</asp:BoundField>
<asp:BoundField DataField="unit" HeaderText="Unit"
SortExpression="unit">
<ItemStyle Width="75px" />
</asp:BoundField>
<asp:BoundField DataField="QtyRecvd"
DataFormatString="{0:g}" HeaderText="QtyRecvd" SortExpression="QtyRecvd">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="Cost"
DataFormatString="{0:n}" HeaderText="Cost" SortExpression="Cost">
<ItemStyle Width="100px" />
</asp:BoundField>
</Columns>
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<PagerStyle BackColor="#999999" ForeColor="Black"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True"
ForeColor="White" />
<HeaderStyle BackColor="#000084" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="#DCDCDC" />
</asp:GridView>
<script type="text/javascript" language="javascript" >
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);
function InitializeRequest(sender, args) {
$get('Container').style.cursor = 'wait';
// Get a reference to the element that raised the postback,
// and disables it.
$get(args._postBackElement.id).disabled = true;
}
function EndRequest(sender, args) {
$get('Container').style.cursor = 'default';
// Get a reference to the element that raised the postback
// which is completing, and enable it.
$get(sender._postBackSettings.sourceElement.id).disabled = false;
}
</script>
<div id="Container" >
<asp:Image ID="Image1" runat="server" Height="43px"
ImageUrl="~/RiverStone LogoJpeg.JPG" Width="134px" />
<asp:Label ID="Label1" runat="server" Height="31px"
style="color: #000080; font-size: x-large; font-weight: 700; font-style: italic; text-align: center"
Text="Receivings Inquiry" Width="372px"></asp:Label>
<asp:Button ID="Button1" runat="server" Height="27px"
style="color: #000080; font-weight: 700; font-style: italic; font-size: small"
Text="Close" Width="79px" />
<br />
<br />
<aspanel ID="Panel1" runat="server" Height="600px" ScrollBars="Both"
Width="879px">
</aspanel>
</div>
It's supposed to be down in the panel. I keep moving it back, saving, and rebuilding; but it keeps moving on me.
Thanks
Cathy
<form id="form1" runat="server"
style="background-color: #FFFFFF; height: 770px;">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
borderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3"
DataSourceID="SqlDataSource1" GridLines="Vertical" Height="173px" PageSize="16"
Width="880px" style="font-size: small">
<RowStyle BackColor="#EEEEEE" ForeColor="Black" />
<Columns>
<asp:CommandField ShowSelectButton="True" >
<ItemStyle Width="65px" />
</asp:CommandField>
<asp:BoundField DataField="RecDate"
DataFormatString="{0:MM/dd/yyyy}" HeaderText="RecDate" SortExpression="RecDate">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="PurchaseOrder"
DataFormatString="{0:g}" HeaderText="PO NO."
SortExpression="PurchaseOrder">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="ProductID" HeaderText="ProductID"
SortExpression="ProductID" >
<ItemStyle Width="75px" />
</asp:BoundField>
<asp:BoundField DataField="description"
HeaderText="Description" SortExpression="description">
<ItemStyle Width="300px" />
</asp:BoundField>
<asp:BoundField DataField="unit" HeaderText="Unit"
SortExpression="unit">
<ItemStyle Width="75px" />
</asp:BoundField>
<asp:BoundField DataField="QtyRecvd"
DataFormatString="{0:g}" HeaderText="QtyRecvd" SortExpression="QtyRecvd">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="Cost"
DataFormatString="{0:n}" HeaderText="Cost" SortExpression="Cost">
<ItemStyle Width="100px" />
</asp:BoundField>
</Columns>
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<PagerStyle BackColor="#999999" ForeColor="Black"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True"
ForeColor="White" />
<HeaderStyle BackColor="#000084" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="#DCDCDC" />
</asp:GridView>
<script type="text/javascript" language="javascript" >
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);
function InitializeRequest(sender, args) {
$get('Container').style.cursor = 'wait';
// Get a reference to the element that raised the postback,
// and disables it.
$get(args._postBackElement.id).disabled = true;
}
function EndRequest(sender, args) {
$get('Container').style.cursor = 'default';
// Get a reference to the element that raised the postback
// which is completing, and enable it.
$get(sender._postBackSettings.sourceElement.id).disabled = false;
}
</script>
<div id="Container" >
<asp:Image ID="Image1" runat="server" Height="43px"
ImageUrl="~/RiverStone LogoJpeg.JPG" Width="134px" />
<asp:Label ID="Label1" runat="server" Height="31px"
style="color: #000080; font-size: x-large; font-weight: 700; font-style: italic; text-align: center"
Text="Receivings Inquiry" Width="372px"></asp:Label>
<asp:Button ID="Button1" runat="server" Height="27px"
style="color: #000080; font-weight: 700; font-style: italic; font-size: small"
Text="Close" Width="79px" />
<br />
<br />
<aspanel ID="Panel1" runat="server" Height="600px" ScrollBars="Both"
Width="879px">
</aspanel>
</div>
It's supposed to be down in the panel. I keep moving it back, saving, and rebuilding; but it keeps moving on me.
Thanks
Cathy