Solved

Dynamic positioning of a panel

Posted on 2006-11-02
23
518 Views
Last Modified: 2012-06-21
Hi,
I'm using asp.net 2.0 with C#.
I have a gridview on a page that can have a variable number of rows, followed by a panel containg more information.
I want to have the panel move up and down on the page depending on the height of the gridview.
I've looked at the panel prerender event, but can't see 'top' as a property.
I'm sure this can't be a dificult thing to do in this day and age.

thanks,
Graham
0
Comment
Question by:graham_ball
  • 11
  • 11
23 Comments
 
LVL 11

Expert Comment

by:ethoths
ID: 17856624
You can always add your own attributes to the html if you like...

In the prerender
    mypanel.Attributes.Add("top", "100")

0
 
LVL 9

Expert Comment

by:Type25
ID: 17856628
0
 

Author Comment

by:graham_ball
ID: 17856684
I've added this to the panel prerender and checked that it does get executed, but nothing changes.

         Panel1.Attributes.Add("top", "100");

0
 

Author Comment

by:graham_ball
ID: 17856815
Is there something else I should be doing here, because whatever value I enter for the 'top' attribute, the panel doesn't change position.
I've already removed the 'top' attribute from the xml.
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17856886
The best thing to do is to figure out what css styling you need. You probably need a position=relative attribute also. To figure it out simple view the page and save the source code to a local html file. You can then edit this file save it and try it in a browser until you get all the settings right and then write them to the control.

0
 

Author Comment

by:graham_ball
ID: 17857135
Well I've looked at the source and made a change to the above statement in the prerender event to:
       Panel1.Style.Add("top",top.ToString());

The event now looks like this;
        int top = 217;
        top += Convert.ToInt32( GridView2.Height.Value);
        Panel1.Style.Add("top",top.ToString());

The html is :
    <div id="ctl00_ContentPlaceHolder1_Panel1" style="height:314px;width:812px;z-index:138;left:10px;position:absolute ;top:217;">

The gridview2.height.value is, for some reason, zero, so I would have expected the panel to be overlapping the grid, but it is not.
It doesn't appear to be anywhere near 217 pixels from the top of the page.

0
 
LVL 11

Expert Comment

by:ethoths
ID: 17857261
It works fine for me. Can you send me your code and also the browser source for the page (right click the  browser, view source).
0
 

Author Comment

by:graham_ball
ID: 17857287
Here it is - thanks.

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Risks.aspx.cs" Inherits="Risks" Title="Risks" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:Risk_Register %>"
        SelectCommand='select trr.RISK_ID , trr.OBJECTIVE_ID, trr.RISK_OWNER_ID, trr.DESCRIPTION, trr.current_mitigation,trr.proposed_mitigation, tc.code_description mgmt_response, trr.WARNING_DESCRIPTION, trr.WARNING_CONDITION, trr.WARNING_THRESHOLD, trr.WARNING_ACTUAL, trr.rank, tc3.code_description owner, tu.USER_NAME delegate, trr.ACTION_DUE_DATE, trr.LAST_REVIEW_DATE, trr.ACCEPTED,trr.version_no, trr.DELEGATE_ID, trr.ACTION_COMPLETED_DATE, trr.CREATION_USER_ID, trr.INHERENT_RISK_SCORE, trr.RESIDUAL_RISK_SCORE from rskt_risk_register trr, exii.t_codes tc, t_codes tc3, rskt_users tu where version_no = (select max(version_no) from rskt_risk_register where objective_id = trr.OBJECTIVE_ID and risk_id = trr.risk_id) and trr.MANAGEMENT_RESPONSE_ID = tc.CODE_ID and trr.RISK_OWNER_ID = tc3.code_id and trr.DELEGATE_ID = tu.USER_ID(+)'
        UpdateCommand=';'
        ProviderName="<%$ ConnectionStrings:Risk_Register.ProviderName %>">
    </asp:SqlDataSource>
    &nbsp;
    <asp:TextBox ID="txtRiskID" runat="server" Style="z-index: 100; left: 639px; position: absolute;
        top: 78px" Visible="False" Width="50px"></asp:TextBox>
    &nbsp; &nbsp;&nbsp;
    <asp:TextBox ID="txtLastReviewed" runat="server" Height="16px" Style="z-index: 105;
        left: 360px; position: absolute; top: 113px" Width="59px" TabIndex="40"></asp:TextBox>
    &nbsp;&nbsp;
    <asp:DropDownList ID="cboClass" runat="server" DataSourceID="Classes" DataTextField="CODE_DESCRIPTION"
        DataValueField="CODE_ID" Style="z-index: 108; left: 74px; position: absolute;
        top: 195px" Width="134px" Enabled="False" TabIndex="85">
    </asp:DropDownList>
    &nbsp; &nbsp;&nbsp;&nbsp;
    <asp:Panel ID="Panel1" runat="server" Height="314px" Style="z-index: 138; left: 10px; position: absolute ; top: 90px;" Width="812px" OnPreRender="Panel1_PreRender" >
        <asp:Label ID="Label19" runat="server" Font-Bold="True" Style="z-index: 100; left: 3px;
            position: absolute; top: 25px" Text="Mitigation"></asp:Label>
        <asp:Label ID="Label18" runat="server" Style="z-index: 101; left: 3px; position: absolute;
            top: 96px" Text="Proposed:"></asp:Label>
        <asp:Label ID="Label17" runat="server" Style="z-index: 102; left: 3px; position: absolute;
            top: 45px" Text="Current:"></asp:Label>
        <asp:Label ID="Label16" runat="server" Style="z-index: 103; left: 3px; position: absolute;
            top: 162px" Text="Who:"></asp:Label>
        <asp:TextBox ID="txtCurrent_Mitigation" runat="server" Height="37px" Style="z-index: 104;
            left: 71px; position: absolute; top: 48px" Width="611px" TabIndex="120" TextMode="MultiLine"></asp:TextBox>
        <asp:TextBox ID="txtProposed_mitigation" runat="server" Height="37px" Style="z-index: 105;
            left: 71px; position: absolute; top: 102px" Width="611px" TabIndex="130" TextMode="MultiLine"></asp:TextBox>
        <asp:TextBox ID="txtCompletedDate" runat="server" Style="z-index: 106; left: 443px; position: absolute;
            top: 159px" Width="65px" TabIndex="170"></asp:TextBox>
        <asp:TextBox ID="txtDateDue" runat="server" Height="16px" Style="z-index: 107; left: 236px;
            position: absolute; top: 157px" Width="68px" TabIndex="160"></asp:TextBox>
        <asp:Label ID="Label14" runat="server" Style="z-index: 108; left: 204px; position: absolute;
            top: 161px" Text="By:"></asp:Label>
        <asp:DropDownList ID="cboDelegate" runat="server" Style="z-index: 109; left: 71px;
            position: absolute; top: 159px" DataSourceID="SqlDataSource2" DataTextField="USER_NAME" DataValueField="USER_ID" TabIndex="150" Width="115px">
        </asp:DropDownList>
        <asp:Label ID="Label2" runat="server" Style="z-index: 110; left: 333px; position: absolute;
            top: 163px" Text="Completed on:"></asp:Label>
        <asp:TextBox ID="txtMonitor" runat="server" Style="z-index: 111; left: 71px; position: absolute;
            top: 191px" Width="209px" TabIndex="180"></asp:TextBox>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="RISK_ID"
            DataSourceID="SqlDataSource1" Style="z-index: 112; left: 4px; position: absolute;
            top: 222px" AllowPaging="True" AllowSorting="True"  OnSelectedIndexChanged="GridView1_Select" EmptyDataText="No data to display " Width="629px" Font-Size="Small">
            <Columns>
                <asp:CommandField  SelectText="Expand" ShowSelectButton="True">
                    <ItemStyle Width="1px" />
                </asp:CommandField>
                <asp:BoundField DataField="RISK_ID" HeaderText="RISK_ID" ReadOnly="True" SortExpression="RISK_ID"
                    Visible="False" />
                <asp:BoundField DataField="OBJECTIVE_ID" HeaderText="OBJECTIVE_ID" SortExpression="OBJECTIVE_ID"
                    Visible="False" />
                <asp:BoundField DataField="RISK_OWNER_ID" HeaderText="RISK_OWNER_ID" SortExpression="RISK_OWNER_ID"
                    Visible="False" />
                <asp:BoundField DataField="CURRENT_MITIGATION" HeaderText="CURRENT_MITIGATION" SortExpression="CURRENT_MITIGATION"
                    Visible="False" />
                <asp:BoundField DataField="PROPOSED_MITIGATION" HeaderText="PROPOSED_MITIGATION" SortExpression="PROPOSED_MITIGATION"
                    Visible="False" />
                 <asp:BoundField DataField="OWNER" HeaderText="Owner" SortExpression=" OWNER " />
               <asp:TemplateField HeaderText="Risk">
                    <ItemTemplate>
                        <asp:Label ID="DESCRIPTION" runat="server" Text='<%# Bind("DESCRIPTION") %>' Width="100px"> </asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="100px" />
                </asp:TemplateField>
               <asp:BoundField DataField="VERSION_NO" HeaderText="Version" SortExpression="VERSION_NO" Visible="False">
                   <ItemStyle Width="1px" />
               </asp:BoundField>
                <asp:TemplateField HeaderText="Mgmt Response" SortExpression="MGMT_RESPONSE"  Visible="False">
                    <ItemTemplate>
                        <asp:Label ID="MGMT_RESPONSE" runat="server" Text='<%# Bind("MGMT_RESPONSE") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="1px" />
                </asp:TemplateField>
                <asp:BoundField DataField="INHERENT_RISK_SCORE" HeaderText="IS"  SortExpression="INHERENT_RISK_SCORE"/>
                <asp:BoundField DataField="RESIDUAL_RISK_SCORE" HeaderText="RS"  SortExpression="RESIDUAL_RISK_SCORE"/>
                <asp:BoundField DataField="WARNING_DESCRIPTION" HeaderText="Monitor"  Visible="False"/>
                <asp:BoundField DataField="WARNING_CONDITION" HeaderText="Condition"  Visible="False" />
                <asp:BoundField DataField="WARNING_THRESHOLD" HeaderText="Limit"   Visible="False"/>
                <asp:BoundField DataField="WARNING_ACTUAL" HeaderText="Actual" Visible="False" />
                <asp:BoundField DataField="RANK" HeaderText="Rank" SortExpression=" RANK " >
                    <ItemStyle Width="1px" />
                </asp:BoundField>
                <asp:BoundField DataField="DELEGATE" HeaderText="Who" SortExpression=" DELEGATE "  Visible="False"/>
                 <asp:TemplateField HeaderText="By" SortExpression="ACTION_DUE_DATE" >
                    <ItemTemplate>
                        <asp:Label ID="ACTION_DUE_DATE" runat="server" Text='<%# Bind("ACTION_DUE_DATE", "{0:d}") %>'></asp:Label>
                    </ItemTemplate>
                      <ItemStyle Width="1px" />
               </asp:TemplateField>
                 <asp:TemplateField HeaderText="Last Reviewed" SortExpression="LAST_REVIEW_DATE">
                    <ItemTemplate>
                        <asp:Label ID="LAST_REVIEW_DATE" runat="server" Text='<%# Bind("LAST_REVIEW_DATE", "{0:d}") %>'></asp:Label>
                    </ItemTemplate>
                     <ItemStyle Width="1px" />
               </asp:TemplateField>
               <asp:BoundField DataField="ACCEPTED" HeaderText="Accepted" SortExpression="ACCEPTED">
                   <ItemStyle Width="1px" />
               </asp:BoundField>
               <asp:BoundField DataField="DELEGATE_ID" HeaderText="Delegate ID" SortExpression="DELEGATE_ID" Visible="False"/>
                 <asp:TemplateField HeaderText="Action Completed" SortExpression="ACTION_COMPLETED_DATE" Visible="False">
                    <ItemTemplate>
                        <asp:Label ID="ACTION_COMPLETED_DATE" runat="server" Text='<%# Bind("ACTION_COMPLETED_DATE", "{0:d}") %>'></asp:Label>
                    </ItemTemplate>
                     <ItemStyle Width="1px" />
               </asp:TemplateField>
                <asp:BoundField DataField="CREATION_USER_ID" HeaderText="Creation User"  Visible="False"/>
            </Columns>
        </asp:GridView>
        <asp:Label ID="Label6" runat="server" Style="z-index: 113; left: 3px; position: absolute;
            top: 3px" Text="Mgmt. Response:"></asp:Label>
        <asp:DropDownList ID="cboManagementResponse" runat="server" Style="z-index: 114;
            left: 173px; position: absolute; top: 0px" Width="137px" DataSourceID="Mgmt_Response" DataTextField="CODE_DESCRIPTION"
            DataValueField="CODE_ID" TabIndex="110">
        </asp:DropDownList>
        <asp:Label ID="Label7" runat="server" Style="z-index: 115; left: 3px; position: absolute;
            top: 194px" Text="Monitor:"></asp:Label>
        <asp:DropDownList ID="cboCondition" runat="server" Style="z-index: 116; left: 297px;
            position: absolute; top: 191px" TabIndex="190">
            <asp:ListItem>&lt;</asp:ListItem>
            <asp:ListItem>=</asp:ListItem>
            <asp:ListItem>&gt;</asp:ListItem>
        </asp:DropDownList>
        <asp:TextBox ID="txtThreshold" runat="server" Style="z-index: 117; left: 336px; position: absolute;
            top: 191px" Width="23px" TabIndex="200"></asp:TextBox>
        <asp:Label ID="Label9" runat="server" Style="z-index: 118; left: 429px; position: absolute;
            top: 194px" Text="Actual:"></asp:Label>
        <asp:TextBox ID="txtActual" runat="server" Height="16px" Style="z-index: 120; left: 486px;
            position: absolute; top: 191px" Width="23px" TabIndex="210"></asp:TextBox>
    </asp:Panel>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server"
        ConnectionString="<%$ ConnectionStrings:Risk_Register %>"
        SelectCommand="select 0 user_id, ' Select User'  user_name from dual union select tu.user_id, tu.user_name from rskt_users tu order by 2"
        ProviderName="<%$ ConnectionStrings:Risk_Register.ProviderName %>">
    </asp:SqlDataSource>
    <asp:Label ID="Label3" runat="server" Style="z-index: 110; left: 10px; position: absolute;
        top: 198px" Text="Classes:" Font-Bold="False"></asp:Label>
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="RISK_ID,VERSION_NO,CLASS_ID"
        DataSourceID="Class_Data" Style="z-index: 111; left: 15px; position: absolute;
        top: 217px" Width="262px" Enabled="False" OnRowUpdating="GridView2_RowUpdating" OnRowDeleting="GridView2_RowDeleting"  
        EmptyDataText="No Classes added." GridLines="None" PageSize="4" AllowPaging="True" >
        <Columns>
            <asp:CommandField ShowEditButton="True" />
            <asp:CommandField ShowDeleteButton="True" />
            <asp:TemplateField HeaderText="Class" SortExpression="CODE_DESCRIPTION">
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownListClass" runat="server" DataSourceID="Classes"
                        DataTextField="CODE_DESCRIPTION" DataValueField="CODE_ID" SelectedValue='<%# Bind("CLASS_ID") %>'
                        Style="z-index: 100;position: relative"  Width="110px">
                    </asp:DropDownList>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:DropDownList ID="DropDownListClass2" runat="server" DataSourceID="Classes"
                        DataTextField="CODE_DESCRIPTION" DataValueField="CODE_ID" SelectedValue='<%# Bind("CLASS_ID") %>'
                        Style="z-index: 100;position: relative"  Width="110px" Enabled="False">
                    </asp:DropDownList>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="RISK_ID" HeaderText="RISK_ID" ReadOnly="True" SortExpression="RISK_ID"
                Visible="False" />
            <asp:BoundField DataField="VERSION_NO" HeaderText="VERSION_NO" ReadOnly="True" SortExpression="VERSION_NO"
                Visible="False" />
            <asp:BoundField DataField="CLASS_ID" HeaderText="CLASS_ID" ReadOnly="True" SortExpression="CLASS_ID"
                Visible="False" />
            <asp:TemplateField HeaderText="II" SortExpression="INHERENT_IMPACT" >
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownListII1" runat="server" DataSourceID="SqlDataSource3"
                        DataTextField="Text" DataValueField="Value" SelectedValue='<%# Bind("INHERENT_IMPACT") %>'
                        Style="z-index: 100;position: relative"  Width="35px">
                    </asp:DropDownList>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:DropDownList ID="DropDownListII2" runat="server" DataSourceID="SqlDataSource3"
                        DataTextField="Text" DataValueField="Value" Enabled="False" SelectedValue='<%# Bind("INHERENT_IMPACT") %>'
                        Style="z-index: 100; position: relative; " Width="35px">
                    </asp:DropDownList>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="IP" SortExpression="INHERENT_PROBABILITY" >
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownListIP1" runat="server" DataSourceID="SqlDataSource3"
                        DataTextField="Text" DataValueField="Value" SelectedValue='<%# Bind("INHERENT_PROBABILITY") %>'
                        Style="z-index: 100;position: relative"  Width="35px">
                    </asp:DropDownList>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:DropDownList ID="DropDownListIP2" runat="server" DataSourceID="SqlDataSource3"
                        DataTextField="Text" DataValueField="Value" Enabled="False" SelectedValue='<%# Bind("INHERENT_PROBABILITY") %>'
                        Style="z-index: 100; position: relative; " Width="35px">
                    </asp:DropDownList>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="RI" SortExpression="RESIDUAL_IMPACT" >
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownListRI1" runat="server" DataSourceID="SqlDataSource3"
                        DataTextField="Text" DataValueField="Value" SelectedValue='<%# Bind("RESIDUAL_IMPACT") %>'
                        Style="z-index: 100;position: relative"  Width="35px">
                    </asp:DropDownList>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:DropDownList ID="DropDownListRI2" runat="server" DataSourceID="SqlDataSource3"
                        DataTextField="Text" DataValueField="Value" Enabled="False" SelectedValue='<%# Bind("RESIDUAL_IMPACT") %>'
                        Style="z-index: 100; position: relative; " Width="35px">
                    </asp:DropDownList>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="RP" SortExpression="RESIDUAL_PROBABILITY" >
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownListRP1" runat="server" DataSourceID="SqlDataSource3"
                        DataTextField="Text" DataValueField="Value" SelectedValue='<%# Bind("RESIDUAL_PROBABILITY") %>'
                        Style="z-index: 100;position: relative"  Width="35px">
                    </asp:DropDownList>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:DropDownList ID="DropDownListRP2" runat="server" DataSourceID="SqlDataSource3"
                        DataTextField="Text" DataValueField="Value" Enabled="False" SelectedValue='<%# Bind("RESIDUAL_PROBABILITY") %>'
                        Style="z-index: 100; position: relative; " Width="35px">
                    </asp:DropDownList>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="CREATION_USER_ID" HeaderText="CREATION_USER_ID" SortExpression="CREATION_USER_ID"
                Visible="False" />
            <asp:BoundField DataField="CREATION_TIMESTAMP" HeaderText="CREATION_TIMESTAMP" SortExpression="CREATION_TIMESTAMP"
                Visible="False" />
        </Columns>
    </asp:GridView>
    &nbsp; &nbsp;&nbsp; &nbsp;
    <asp:TextBox ID="txtObjectiveID" runat="server" Height="16px" Style="z-index: 113;
        left: 711px; position: absolute; top: 78px" Width="50px" Visible="False"></asp:TextBox>
    <asp:TextBox ID="txtVersionNo" runat="server" Style="z-index: 114; left: 783px; position: absolute;
        top: 75px" Visible="False" Width="50px" Height="16px"></asp:TextBox>
    <asp:Label ID="Label15" runat="server" Style="z-index: 115; left: 360px; position: absolute;
        top: 92px" Text="Last Reviewed"></asp:Label>
    &nbsp; &nbsp;&nbsp;
    <asp:CheckBox ID="chkAccepted" runat="server" Style="z-index: 118; left: 471px; position: absolute;
        top: 93px" Text="Accepted" TextAlign="Left" Width="62px" Height="42px" TabIndex="50" />
    &nbsp; &nbsp;&nbsp;
     <asp:SqlDataSource ID="SqlDataSource3" runat="server"
        ConnectionString="<%$ ConnectionStrings:Risk_Register %>"
        SelectCommand='select 1 "Value",1 "Text" from dual union select 2,2 from dual union select 3,3 from dual union select 4,4 from dual union select 5,5 from dual'
        ProviderName="<%$ ConnectionStrings:Risk_Register.ProviderName %>">
    </asp:SqlDataSource>
    &nbsp;&nbsp;
    <asp:Button ID="btnClassAdd" runat="server" OnClick="btnClassAdd_Click" Style="z-index: 121;
        left: 212px; position: absolute; top: 196px" Text="+" Enabled="False" Height="21px" Width="19px" />
    <asp:SqlDataSource ID="Class_Data" runat="server" ConnectionString="<%$ ConnectionStrings:Risk_Register %>"
        ProviderName="<%$ ConnectionStrings:Risk_Register.ProviderName %>"
        SelectCommand='SELECT TC.CODE_DESCRIPTION, RSKT.* FROM RSKT_RISK_CLASSES RSKT, T_CODES TC WHERE RISK_ID = :RISK_ID AND VERSION_NO = :VERSION_NO AND RSKT.CLASS_ID = TC.CODE_ID'>
        <SelectParameters>
            <asp:ControlParameter ControlID="txtRiskID" Name="RISK_ID" PropertyName="Text" Type="Decimal" />
            <asp:ControlParameter ControlID="txtVersionNo" Name="VERSION_NO" PropertyName="Text"
                Type="Decimal" />
        </SelectParameters>
   </asp:SqlDataSource>
     <asp:SqlDataSource ID="Roles" runat="server"
        ConnectionString="<%$ ConnectionStrings:Risk_Register %>"
        SelectCommand="select 0 code_id, ' Select Role' code_description from dual union select code_id,code_description from t_codes where code_type_id = 464 order by 2"
        ProviderName="<%$ ConnectionStrings:Risk_Register.ProviderName %>">
    </asp:SqlDataSource>
    &nbsp;
     <asp:SqlDataSource ID="Classes" runat="server"
        ConnectionString="<%$ ConnectionStrings:Risk_Register %>"
        SelectCommand="select 0 code_id, ' Select Class' code_description from dual union  select code_id,code_description from t_codes where code_type_id = 465 order by 2"
        ProviderName="<%$ ConnectionStrings:Risk_Register.ProviderName %>">
    </asp:SqlDataSource>
      <asp:SqlDataSource ID="Mgmt_Response" runat="server"
        ConnectionString="<%$ ConnectionStrings:Risk_Register %>"
        SelectCommand="select 0 code_id, ' Select Response' code_description from dual union select code_id,code_description from t_codes where code_type_id = 466"
        ProviderName="<%$ ConnectionStrings:Risk_Register.ProviderName %>">
    </asp:SqlDataSource>
  <asp:DropDownList ID="cboOwner" runat="server" Style="z-index: 123; left: 10px;
        position: absolute; top: 113px" Width="140px" DataSourceID="Roles" DataTextField="CODE_DESCRIPTION" DataValueField="CODE_ID" TabIndex="10" Height="1px">
    </asp:DropDownList>
    &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
    <asp:Label ID="Label1" runat="server" Style="z-index: 125; left: 10px; position: absolute;
        top: 139px" Text="Description:"></asp:Label>
    <asp:TextBox ID="txtDescription" runat="server" Height="40px" MaxLength="1000" Style="z-index: 126;
        left: 89px; position: absolute; top: 142px" Width="602px" TabIndex="80" TextMode="MultiLine" ></asp:TextBox>
    &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
    <asp:Label ID="Label12" runat="server" Style="z-index: 134; left: 168px; position: absolute;
        top: 92px" Text="Rank"></asp:Label>
    <asp:DropDownList ID="cboRank" runat="server" Height="1px" Style="z-index: 135; left: 168px;
        position: absolute; top: 113px" TabIndex="30">
        <asp:ListItem Value="S">Select Rank</asp:ListItem>
        <asp:ListItem Value="H">High</asp:ListItem>
        <asp:ListItem Value="M">Medium</asp:ListItem>
        <asp:ListItem Value="L">Low</asp:ListItem>
        <asp:ListItem Value="Z">Minimal</asp:ListItem>
    </asp:DropDownList>
    <asp:Label ID="Label13" runat="server" Style="z-index: 136; left: 10px; position: absolute;
        top: 92px" Text="Owner"></asp:Label>
    <asp:Button ID="btnAdd" runat="server" Style="z-index: 137; left: 640px; position: absolute;
        top: 111px" Text="Add" OnClick="btnAdd_Click" />
    &nbsp; &nbsp;
</asp:Content>



<!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><title>
      Risks
</title>
    <style type="text/css">
    A:unknown { COLOR: blue }

    A:visited { COLOR: blue }

    A:hover { COLOR: blue }

    </style>
    <link href="applicationforms.css" rel="stylesheet" type="text/css" /></head>
<body bgcolor="#99ccff">
    <form name="aspnetForm" method="post" action="Risks.aspx" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'ctl00_ContentPlaceHolder1_btnAdd')" id="aspnetForm">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="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" />
</div>

<script type="text/javascript">
<!--
var theForm = document.forms['aspnetForm'];
if (!theForm) {
    theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
// -->
</script>


<script src="/Risk_Register/WebResource.axd?d=4P75uVxFnSDWWue26fbfag2&amp;t=632842339181171875" type="text/javascript"></script>


<script src="/Risk_Register/WebResource.axd?d=RiQzLI1hQUvHgnEbCxKsfA2&amp;t=632842339181171875" type="text/javascript"></script>
            <table border="0" cellpadding="0" cellspacing="0" style="z-index: 100; left: 3px;
                width: 102%; position: absolute; top: 0px; height: 102%">
                <tr>
                    <td  style="height: 83px; text-align: center;">
                        &nbsp;&nbsp;
                        <span id="ctl00_Label2" style="font-family:Arial;font-size:X-Large;font-weight:bold;z-index: 101;
                            left: 4px; position: absolute; top: 3px">Risk Register</span>
                        &nbsp; &nbsp; &nbsp; &nbsp;
                        <input type="submit" name="ctl00$btnObjectives" value="Objectives" id="ctl00_btnObjectives" style="color:Black;background-color:LightSteelBlue;font-family:Arial;width:126px;z-index: 101;
                            left: 4px; position: absolute; top: 51px" />
                       
                            <input type="submit" name="ctl00$btnSources" value="Sources" id="ctl00_btnSources" style="color:Black;background-color:LightSteelBlue;font-family:Arial;width:126px;z-index: 102;
                            left: 139px; position: absolute; top: 51px" />
                       
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="height: 553px; width: 1023px;">
                        &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
                       
   
    &nbsp;
   
    &nbsp; &nbsp;&nbsp;
    <input name="ctl00$ContentPlaceHolder1$txtLastReviewed" type="text" id="ctl00_ContentPlaceHolder1_txtLastReviewed" tabindex="40" style="height:16px;width:59px;z-index: 105;
        left: 360px; position: absolute; top: 113px" />
    &nbsp;&nbsp;
    <select name="ctl00$ContentPlaceHolder1$cboClass" id="ctl00_ContentPlaceHolder1_cboClass" disabled="disabled" tabindex="85" style="width:134px;z-index: 108; left: 74px; position: absolute;
        top: 195px">
      <option selected="selected" value="0"> Select Class</option>
      <option value="1005966">Financial</option>
      <option value="1005964">Legal</option>
      <option value="1005963">Process</option>
      <option value="1005965">Regulatory</option>
      <option value="1005967">Reputational</option>
      <option value="1005968">Strategic</option>

</select>
    &nbsp; &nbsp;&nbsp;&nbsp;
    <div id="ctl00_ContentPlaceHolder1_Panel1" style="height:314px;width:812px;z-index:138;left:10px;position:absolute ;top:217;">
      
        <span id="ctl00_ContentPlaceHolder1_Label19" style="font-weight:bold;z-index: 100; left: 3px;
            position: absolute; top: 25px">Mitigation</span>
        <span id="ctl00_ContentPlaceHolder1_Label18" style="z-index: 101; left: 3px; position: absolute;
            top: 96px">Proposed:</span>
        <span id="ctl00_ContentPlaceHolder1_Label17" style="z-index: 102; left: 3px; position: absolute;
            top: 45px">Current:</span>
        <span id="ctl00_ContentPlaceHolder1_Label16" style="z-index: 103; left: 3px; position: absolute;
            top: 162px">Who:</span>
        <textarea name="ctl00$ContentPlaceHolder1$txtCurrent_Mitigation" rows="2" cols="20" id="ctl00_ContentPlaceHolder1_txtCurrent_Mitigation" tabindex="120" style="height:37px;width:611px;z-index: 104;
            left: 71px; position: absolute; top: 48px"></textarea>
        <textarea name="ctl00$ContentPlaceHolder1$txtProposed_mitigation" rows="2" cols="20" id="ctl00_ContentPlaceHolder1_txtProposed_mitigation" tabindex="130" style="height:37px;width:611px;z-index: 105;
            left: 71px; position: absolute; top: 102px"></textarea>
        <input name="ctl00$ContentPlaceHolder1$txtCompletedDate" type="text" id="ctl00_ContentPlaceHolder1_txtCompletedDate" tabindex="170" style="width:65px;z-index: 106; left: 443px; position: absolute;
            top: 159px" />
        <input name="ctl00$ContentPlaceHolder1$txtDateDue" type="text" id="ctl00_ContentPlaceHolder1_txtDateDue" tabindex="160" style="height:16px;width:68px;z-index: 107; left: 236px;
            position: absolute; top: 157px" />
        <span id="ctl00_ContentPlaceHolder1_Label14" style="z-index: 108; left: 204px; position: absolute;
            top: 161px">By:</span>
        <select name="ctl00$ContentPlaceHolder1$cboDelegate" id="ctl00_ContentPlaceHolder1_cboDelegate" tabindex="150" style="width:115px;z-index: 109; left: 71px;
            position: absolute; top: 159px">
            <option value="0"> Select User</option>
            <option value="32">Amanda Hurst</option>
            <option value="1">Graham Ball</option>

      </select>
        <span id="ctl00_ContentPlaceHolder1_Label2" style="z-index: 110; left: 333px; position: absolute;
            top: 163px">Completed on:</span>
        <input name="ctl00$ContentPlaceHolder1$txtMonitor" type="text" id="ctl00_ContentPlaceHolder1_txtMonitor" tabindex="180" style="width:209px;z-index: 111; left: 71px; position: absolute;
            top: 191px" />
        <div>
            <table cellspacing="0" rules="all" border="1" id="ctl00_ContentPlaceHolder1_GridView1" style="font-size:Small;width:629px;border-collapse:collapse;z-index: 112; left: 4px; position: absolute;
            top: 222px">
                  <tr>
                        <th scope="col">&nbsp;</th><th scope="col">Risk</th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$VERSION_NO')">Version</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$MGMT_RESPONSE')">Mgmt Response</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$INHERENT_RISK_SCORE')">IS</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$RESIDUAL_RISK_SCORE')">RS</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$ DELEGATE ')">Who</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$ACTION_DUE_DATE')">By</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$LAST_REVIEW_DATE')">Last Reviewed</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$ACCEPTED')">Accepted</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$ACTION_COMPLETED_DATE')">Action Completed</a></th>
                  </tr><tr>
                        <td style="width:1px;"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Select$0')">Expand</a></td><td style="width:100px;">
                        <span id="ctl00_ContentPlaceHolder1_GridView1_ctl02_DESCRIPTION" style="display:inline-block;width:100px;">Risky business
a
b
c
d
e
f
</span>
                    </td><td style="width:1px;">28</td><td style="width:1px;">
                        <span id="ctl00_ContentPlaceHolder1_GridView1_ctl02_MGMT_RESPONSE">Treat</span>
                    </td><td>14</td><td>27</td><td>&nbsp;</td><td style="width:1px;">
                        <span id="ctl00_ContentPlaceHolder1_GridView1_ctl02_ACTION_DUE_DATE"></span>
                    </td><td style="width:1px;">
                        <span id="ctl00_ContentPlaceHolder1_GridView1_ctl02_LAST_REVIEW_DATE"></span>
                    </td><td style="width:1px;">N</td><td style="width:1px;">
                        <span id="ctl00_ContentPlaceHolder1_GridView1_ctl02_ACTION_COMPLETED_DATE"></span>
                    </td>
                  </tr>
            </table>
      </div>
        <span id="ctl00_ContentPlaceHolder1_Label6" style="z-index: 113; left: 3px; position: absolute;
            top: 3px">Mgmt. Response:</span>
        <select name="ctl00$ContentPlaceHolder1$cboManagementResponse" id="ctl00_ContentPlaceHolder1_cboManagementResponse" tabindex="110" style="width:137px;z-index: 114;
            left: 173px; position: absolute; top: 0px">
            <option value="0"> Select Response</option>
            <option value="1005969">Terminate</option>
            <option value="1005970">Treat</option>
            <option value="1005971">Tolerate</option>
            <option value="1005972">Transfer</option>

      </select>
        <span id="ctl00_ContentPlaceHolder1_Label7" style="z-index: 115; left: 3px; position: absolute;
            top: 194px">Monitor:</span>
        <select name="ctl00$ContentPlaceHolder1$cboCondition" id="ctl00_ContentPlaceHolder1_cboCondition" tabindex="190" style="z-index: 116; left: 297px;
            position: absolute; top: 191px">
            <option value="&lt;">&lt;</option>
            <option value="=">=</option>
            <option value=">">&gt;</option>

      </select>
        <input name="ctl00$ContentPlaceHolder1$txtThreshold" type="text" id="ctl00_ContentPlaceHolder1_txtThreshold" tabindex="200" style="width:23px;z-index: 117; left: 336px; position: absolute;
            top: 191px" />
        <span id="ctl00_ContentPlaceHolder1_Label9" style="z-index: 118; left: 429px; position: absolute;
            top: 194px">Actual:</span>
        <input name="ctl00$ContentPlaceHolder1$txtActual" type="text" id="ctl00_ContentPlaceHolder1_txtActual" tabindex="210" style="height:16px;width:23px;z-index: 120; left: 486px;
            position: absolute; top: 191px" />
   
</div>
   
    <span id="ctl00_ContentPlaceHolder1_Label3" style="font-weight:normal;z-index: 110; left: 10px; position: absolute;
        top: 198px">Classes:</span>
    <div>
      <table disabled="disabled" cellspacing="0" border="0" id="ctl00_ContentPlaceHolder1_GridView2" style="width:262px;border-collapse:collapse;z-index: 111; left: 15px; position: absolute;
        top: 217px">
            <tr>
                  <td>No Classes added.</td>
            </tr>
      </table>
</div>
    &nbsp; &nbsp;&nbsp; &nbsp;
   
   
    <span id="ctl00_ContentPlaceHolder1_Label15" style="z-index: 115; left: 360px; position: absolute;
        top: 92px">Last Reviewed</span>
    &nbsp; &nbsp;&nbsp;
    <span style="display:inline-block;height:42px;width:62px;z-index: 118; left: 471px; position: absolute;
        top: 93px"><label for="ctl00_ContentPlaceHolder1_chkAccepted">Accepted</label><input id="ctl00_ContentPlaceHolder1_chkAccepted" type="checkbox" name="ctl00$ContentPlaceHolder1$chkAccepted" tabindex="50" /></span>
    &nbsp; &nbsp;&nbsp;
     
    &nbsp;&nbsp;
    <input type="submit" name="ctl00$ContentPlaceHolder1$btnClassAdd" value="+" id="ctl00_ContentPlaceHolder1_btnClassAdd" disabled="disabled" style="height:21px;width:19px;z-index: 121;
        left: 212px; position: absolute; top: 196px" />
   
     
    &nbsp;
     
     
  <select name="ctl00$ContentPlaceHolder1$cboOwner" id="ctl00_ContentPlaceHolder1_cboOwner" tabindex="10" style="height:1px;width:140px;z-index: 123; left: 10px;
        position: absolute; top: 113px">
      <option value="0"> Select Role</option>
      <option value="1005960">EC</option>
      <option value="1005961">HoD</option>
      <option value="1006000">Risk Manager</option>
      <option value="1005962">Risk Owner</option>

</select>
    &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
    <span id="ctl00_ContentPlaceHolder1_Label1" style="z-index: 125; left: 10px; position: absolute;
        top: 139px">Description:</span>
    <textarea name="ctl00$ContentPlaceHolder1$txtDescription" rows="2" cols="20" id="ctl00_ContentPlaceHolder1_txtDescription" tabindex="80" style="height:40px;width:602px;z-index: 126;
        left: 89px; position: absolute; top: 142px"></textarea>
    &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
    <span id="ctl00_ContentPlaceHolder1_Label12" style="z-index: 134; left: 168px; position: absolute;
        top: 92px">Rank</span>
    <select name="ctl00$ContentPlaceHolder1$cboRank" id="ctl00_ContentPlaceHolder1_cboRank" tabindex="30" style="height:1px;z-index: 135; left: 168px;
        position: absolute; top: 113px">
      <option value="S">Select Rank</option>
      <option value="H">High</option>
      <option value="M">Medium</option>
      <option value="L">Low</option>
      <option value="Z">Minimal</option>

</select>
    <span id="ctl00_ContentPlaceHolder1_Label13" style="z-index: 136; left: 10px; position: absolute;
        top: 92px">Owner</span>
    <input type="submit" name="ctl00$ContentPlaceHolder1$btnAdd" value="Edit" id="ctl00_ContentPlaceHolder1_btnAdd" disabled="disabled" style="z-index: 137; left: 640px; position: absolute;
        top: 111px" />
    &nbsp; &nbsp;

                    </td>
                </tr>
            </table>
   
<div>

      <input type="hidden" name="__VIEWSTATEENCRYPTED" id="__VIEWSTATEENCRYPTED" value="" />
      <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="Y9sj/KQT44aBuhk11lUIqi1gC4cebl8z0KwKVS/zRFlYTKRJ9qdF52q4TDDYMhn/d1LK3xJ23CpYzh5qp5ttgNEh66Xk4C0Lw9R44vepHYdqxlg0YpiMGISb94qlS8Y3Ha0jKUORIY9xwidGLD9LWg0UBdChaFqcxlivxG+WV1zNfSlwGYanhaKwjMrexdIuDFbxMpRr+XjQ7wogls1iEKhp1BJhIHiieVmm8J5BqklF7hQLOFhCuz3GXxpBQ2FpSy103SF8ciPRye78Qz+/o3c7ifd1xqAg+s/uW5cvEOfXS79BfSU4hGVW+xqvbGBPypmDmQ/Pv4FQd1nlRbA/uJed0JhTXJazPJr+bw8a4Puj+prRF6fqH3XXXxdeqovwmkeeXIaWpwLCLvB7tsJcl/1Fzrj0U6gEn1gqqkAmx+YtiDEeV9u8yMOaONg3zFtc" />
</div>

<script type="text/javascript">
<!--
WebForm_AutoFocus('ctl00$ContentPlaceHolder1$btnAdd');// -->
</script>
</form>
</body>
</html>


0
 
LVL 11

Accepted Solution

by:
ethoths earned 250 total points
ID: 17857712
Try putting the px on the end of the top position like...

    <div style="height:314px;width:100px;z-index:138;left:10px;position:absolute;top:100px;">
0
 

Author Comment

by:graham_ball
ID: 17857741
You hero - thanks!

Double points if you can tell me why I'm not getting the height of the gridview (and how to get it, if I'm doing it wrong).
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17857882
Not sure really. Could be that the height of the datagrid is not know until the render stage. In fact, because the height of each row could be set by css rules, it might not even be known by the run-time at that late stage. You can find the number of rows in the datagrid and multiply that by the values you explicitly set in the row height (however you choose to do that, server side attruibute, css class etc..).

0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:graham_ball
ID: 17857915
Ok, I'll try that.
I notice that in your original reply, you only had 100, not 100px and I assume that works for you.
Why didn't it work for me ? Or did it , but just in a different scale?
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17857979
It was a typo. I also needed the px for it to work.
0
 

Author Comment

by:graham_ball
ID: 17858054
Aaarrgh!
Sorry - one more question.
The panel renders first and I can't get the number of rows in the gridview.
Can I change the order they are rendered?
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17858070
Can see why not.
0
 

Author Comment

by:graham_ball
ID: 17858112
do you know how?
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17858146
The prerender event...
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender

has access to everything prior to the page being rendered. If you've used an asp:panel for your div then simply set the top attribute here with the no of rows in the data grid...


myPanel.attributes.add("top", myDataGrid.Items.Count * 20 & "px")

I'm pretty sure that'll do it but you may have to mess about with it a little.
0
 

Author Comment

by:graham_ball
ID: 17858324
The page PreRender is executed first followed by the panel , then the grid.
So I can't get to the Grid.rows.count.
This is bizarre - I imagine I can't change this order ?
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17858358
I don't understand what you mean. What do you mean by the panel executes after the PreRender?

Send me your code and the code behind
0
 

Author Comment

by:graham_ball
ID: 17858427
I just debugged the app and the first thing to get executed is the Page_PreRender, hit F5 then it executes Panel1_PreRender, hit F5 and it finally executes Gridview2_PreRender.
Obviously, I don't get any row count until the grid_preRender.

I suppose that the Page woulr prerender first to give other controls somewhere to sit.
So what I really need to find out is whether I can get the gridview to prerender before the panel.
0
 

Author Comment

by:graham_ball
ID: 17858548
OK cracked it.
Turns out that I can still affect the panel attributes in the Gridview_PreRender event.
Thanks for your help.
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17858575
In ASP.Net 2.0 use the PreRenderComplete event...

    Protected Sub Page_PreRenderComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRenderComplete

This executes after all the render code is written and so the row count iof the datagrid should now be known.

0
 
LVL 11

Expert Comment

by:ethoths
ID: 17858587
Crossed answers. It looks like as I originally thought - the item count is determined at the databind event not the prerender.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now