S
SAL
Hello,
Using VS2005, AJAX toolkit.
I have a page that has 2 update panels on it. The top Updatepanel has a
gridview (gvStormDetail) in it and the bottom one has a details view
(dvInsert).
In gvStormDetail, there's a textbox in a column for user input. There's a
button control in this updatepanel for updating this page of gridview rows
all at once.
In dvInsert there's a dropdownlist control that gets updated with values
when the user selects a category type from a dropdown, in this updatepanel,
but outside of the detailsview.
The problem is that when a user changes some text in gvStormDetail and then
hits the Enter Key, a postback occurs and the gridview now shows the first
row as a selected row. Then, if the user clicks the button for updating the
values in this gridview, a message box appears with the following text in
it.
'ddlStormAssetE' has a SelectedValue which is invalid because it does not
exist in the list of items. Parameter name: value
So, I have some questions:
1. Is there a way to keep this postback from occuring when the user hit the
enter key in this textbox inside a row in gvStormDetail?
2. I have not be able to find out the event that's firing and how could I do
that?
3. How can I keep the first row of the gridview from being selected?
Also, this message appears no matter what control is clicked on after this
happens so the page has to be left and come back to before it behaves
correctly again. I'll post the html source if it might help.
<%@ Page Language="VB" MasterPageFile="~/Master/GISMasterPage.master"
AutoEventWireup="false" CodeFile="StormDetails.aspx.vb"
Inherits="Public_StormDetails" title="Storm Edit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent"
Runat="Server">
<aspanel ID="pnlHeader" runat="server" EnableViewState="False"
HorizontalAlign="Center"
Width="100%">
<aspetailsView ID="dvHeader" runat="server"
AutoGenerateRows="False" DataKeyNames="CntyAssetID"
DataSourceID="dsHeader" SkinID="dvplainSkin" Width="328px">
<Fields>
<asp:BoundField DataField="CntyAssetID" HeaderText="County
Asset ID" InsertVisible="False"
ReadOnly="True" SortExpression="CntyAssetID">
<HeaderStyle Font-Bold="True" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="Name" HeaderText="Name"
SortExpression="Name">
<HeaderStyle Font-Bold="True" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="Bkpg" HeaderText="Book page"
SortExpression="Bkpg">
<HeaderStyle Font-Bold="True" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="TotalValue"
DataFormatString="{0:C0}" HeaderText="Total Value"
HtmlEncode="False" SortExpression="TotalValue">
<HeaderStyle Font-Bold="True" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="RecordingDate"
DataFormatString="{0:MM/dd/yyyy}" HeaderText="Recording Date"
HtmlEncode="False" SortExpression="RecordingDate">
<HeaderStyle Font-Bold="True" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
</Fields>
<HeaderStyle Font-Bold="False" />
</aspetailsView>
<asp:ObjectDataSource ID="dsHeader" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetBundleHeaderById" TypeName="BundleHeaderBLL">
<SelectParameters>
<asp:SessionParameter Name="id" SessionField="cntyAssetId"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</aspanel>
<br />
<br />
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div id="gridviewDiv" runat="server" style="border-color:#EFEFEF;
border-style:solid; border-width:2px">
<asp:UpdatePanel ID="UpdatePanel1" runat="server"
EnableViewState="False">
<ContentTemplate>
<asp:GridView ID="gvStormDetail"
runat="server"
AutoGenerateColumns="False"
DataSourceID="dsStormDetail"
EnableViewState="False"
SkinID="gridviewSkin"
Width="672px"
DataKeyNames="StormValueID"
AllowSorting="True">
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:ImageButton ID="lbEdit"
runat="server"
CausesValidation="False"
CommandName="Select"
ImageUrl="~/Images/edit_white2.gif"
CommandArgument="EditMe" EnableViewState="False">
</asp:ImageButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:ImageButton ID="lbDelete"
runat="server"
CausesValidation="False"
CommandName="Delete"
OnClientClick="return confirm('Are you sure
you want to delete this Storm Record?');"
ImageUrl="~/Images/Delete.gif"
ToolTip="Delete this record permanently"
EnableViewState="False">
</asp:ImageButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="hlMap" runat="server"
Target="_map">Map</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="StormValueID"
HeaderText="StormValueID" InsertVisible="False"
ReadOnly="True" SortExpression="StormValueID"
Visible="False" />
<asp:BoundField DataField="StormAssetType"
HeaderText="Asset Category" SortExpression="StormAssetType" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="StormAssetTypeID"
HeaderText="StormAssetTypeID" SortExpression="StormAssetTypeID"
Visible="False" />
<asp:TemplateField HeaderText="Storm Asset Name"
SortExpression="StormAssetName">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server"
Text='<%# Bind("StormAssetName") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("StormAssetName") %>' Width="200px"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="StmFacilityClkID"
SortExpression="StmFacilityClkID">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server"
Text='<%# Bind("StmFacilityClkID") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblStmFacilityClkId"
runat="server" Text='<%# Bind("StmFacilityClkID") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Description"
SortExpression="Description">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server"
Text='<%# Bind("Description") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblDescription" runat="server"
EnableViewState="False" Height="24px"
Text='<%# Bind("Description") %>'
Width="232px"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Estimated Value"
SortExpression="EstValue">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Bind("EstValue") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblEstValue" runat="server"
Text='<%# Bind("EstValue", "{0:C0}") %>'></asp:Label>
<asp:TextBox ID="txtEstValue" runat="server"
EnableViewState="False" Text='<%# Bind("EstValue", "{0:C0}") %>'
Visible="False" Width="96px"
OnTextChanged="txtEstValue_TextChanged"></asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField DataField="CntyAssetID"
HeaderText="CntyAssetID" SortExpression="CntyAssetID"
Visible="False" />
<asp:TemplateField></asp:TemplateField>
<asp:BoundField DataField="ModUser" HeaderText="ModUser"
SortExpression="ModUser">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="ModDate"
DataFormatString="{0:MM/dd/yyyy}" HeaderText="ModDate"
HtmlEncode="False" SortExpression="ModDate">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
</Columns>
</asp:GridView>
<br />
<asp:ObjectDataSource ID="dsStormDetail" runat="server"
SelectMethod="GetStormAssetsByCntyAssetdId"
TypeName="StormAssetsMainBLL"
EnableViewState="False"
DeleteMethod="Delete">
<SelectParameters>
<asp:SessionParameter Name="id"
SessionField="cntyAssetId" Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asparameter Name="stormValueId" Type="Int32" />
</DeleteParameters>
</asp:ObjectDataSource>
<table id="tblTotalValue" style="font-family:Arial;
font-size:10pt" width="100%">
<tr>
<td style="width:25%">
<asp:Label ID="lblTotalLabel" runat="server"
Font-Names="Arial" Font-Size="10pt"
Text="Total Estimated Value:"
Width="168px"></asp:Label></td>
<td style="width:25%"></td>
<td style="width:25%"></td>
<td style="width:25%">
<asp:Label ID="lblTotal" runat="server"
Font-Names="Arial" Font-Size="10pt" Text="Total Value:"
Width="96px"></asp:Label></td>
</tr>
</table>
<br />
<asp:Button ID="btnUpdate" runat="server"
EnableViewState="False"
Text="Save Changes" OnClick="btnUpdate_Click"
CausesValidation="False" ToolTip="Saves your Estimated Value changes"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="dvStormInsert"
EventName="ItemInserting" />
</Triggers>
</asp:UpdatePanel>
</div>
<br />
<br />
<div>
<br />
<asp:UpdatePanel ID="upInsert" runat="server"
UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblAssetType" runat="server"
EnableViewState="False" Font-Size="10pt"
Text="Category" Width="104px" BackColor="#EFEFEF"
Height="18px"></asp:Label><aspropDownList ID="ddlAssetType" runat="server"
AutoPostBack="True"
DataSourceID="dsAssetTypes"
DataTextField="StormAssetType"
DataValueField="StormAssetTypeID"
Width="236px" EnableViewState="False">
</aspropDownList>
<asp:ObjectDataSource ID="dsAssetTypes" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetAssetTypesPlusNone"
TypeName="StormAssetTypeBLL"
EnableViewState="False">
</asp:ObjectDataSource>
<br />
<aspetailsView ID="dvStormInsert"
runat="server"
DefaultMode="Insert"
EnableViewState="False"
Height="50px"
Width="368px"
SkinID="detailsviewSkin"
AutoGenerateRows="False"
DataKeyNames="StormValueID"
DataSourceID="dsStormInsert" >
<Fields>
<asp:TemplateField HeaderText="StormValueID"
InsertVisible="False" SortExpression="StormValueID">
<EditItemTemplate>
<asp:Label ID="lblStormValueId" runat="server"
Text='<%# Eval("StormValueID") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%#
Bind("StormValueID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CntyAssetID"
SortExpression="CntyAssetID">
<EditItemTemplate>
<asp:Label ID="lblCntyAssetId" runat="server"
Text='<%# Eval("CntyAssetID") %>' Width="184px"></asp:Label>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtCntyAssetId" runat="server"
Enabled="False" EnableViewState="False"
Text='<%# Bind("CntyAssetID") %>'
Width="230px"></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("CntyAssetID") %>' Width="176px"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Storm Asset"
SortExpression="StormAssetID">
<EditItemTemplate><aspropDownList
ID="ddlStormAssetE"
runat="server"
DataSourceID="dsStormAssetE"
DataTextField="StormAssetName"
DataValueField="StormAssetID"
Width="236px" SelectedValue='<%#
Bind("StormAssetID") %>'>
</aspropDownList><br />
<asp:ObjectDataSource ID="dsStormAssetE"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetStormAssetsByAssetTypeId"
TypeName="StormAssetsBLL">
<SelectParameters>
<asp:ControlParameter
ControlID="ddlAssetType"
Name="id"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</EditItemTemplate>
<InsertItemTemplate>
<aspropDownList ID="ddlStormAsset"
runat="server"
DataSourceID="dsStormAsset"
DataTextField="StormAssetName"
DataValueField="StormAssetID"
Width="236px" EnableViewState="False">
</aspropDownList>
<asp:ObjectDataSource ID="dsStormAsset"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetStormAssetsByAssetTypeId"
TypeName="StormAssetsBLL">
<SelectParameters>
<asp:ControlParameter
ControlID="ddlAssetType"
Name="id"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("StormAssetID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Description"
SortExpression="Description">
<EditItemTemplate>
<asp:TextBox ID="txtDescriptionE" runat="server"
EnableViewState="False" Text='<%# Bind("Description") %>'
TextMode="MultiLine"
Width="230px"></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtDescription" runat="server"
Text='<%# Bind("Description") %>' EnableViewState="False"
TextMode="MultiLine" Width="230px"></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%#
Bind("Description") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estimated Value"
SortExpression="EstValue">
<EditItemTemplate>
<asp:TextBox ID="txtEstValueE" runat="server"
Text='<%# Bind("EstValue") %>' Width="230px"></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtEstValue" runat="server"
Text='<%# Bind("EstValue") %>' Width="230px"></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%#
Bind("EstValue") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="StmFacilityClkID"
SortExpression="UniqueID">
<EditItemTemplate>
<asp:TextBox ID="txtUniqueIdE" runat="server"
Text='<%# Bind("StmFacilityClkID") %>'
Width="230px"></asp:TextBox><asp:RequiredFieldValidator
ID="rfvUniqueIdE" runat="server"
ControlToValidate="txtUniqueIdE"
EnableViewState="False" ErrorMessage="StmFacilityClkID is a required field"
EnableClientScript="False">*</asp:RequiredFieldValidator>
<asp:CustomValidator ID="cvStmFacilityClkIdE"
runat="server" ControlToValidate="txtUniqueIdE"
ErrorMessage="StmFacilityClkID is not valid"
EnableViewState="False"
OnServerValidate="ServerValidateID">*</asp:CustomValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtUniqueId" runat="server"
Text='<%# Bind("StmFacilityClkID") %>'
Width="230px"></asp:TextBox><asp:RequiredFieldValidator ID="rfvUniqueId"
runat="server" EnableViewState="False"
ErrorMessage="StmFacilityClkID is a required
field" ControlToValidate="txtUniqueId" Display="Dynamic"
EnableClientScript="False">*</asp:RequiredFieldValidator>
<asp:CustomValidator ID="cvStmFacilityClkIdI"
runat="server"
ControlToValidate="txtUniqueId"
EnableViewState="False" ErrorMessage="StmFacilityClkID is not valid"
OnServerValidate="ServerValidateID">*</asp:CustomValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%#
Bind("StmFacilityClkID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<InsertItemTemplate>
<asp:LinkButton ID="lbInsert" runat="server"
CausesValidation="True"
CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="lbCancel" runat="server"
CausesValidation="False"
CommandName="Cancel"
OnClick="lbCancel_Click"
Text="Cancel"></asp:LinkButton>
</InsertItemTemplate>
<ItemTemplate>
</ItemTemplate>
</asp:TemplateField>
</Fields>
</aspetailsView>
<asp:ObjectDataSource ID="dsStormInsert" runat="server"
EnableViewState="False" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetStormValueByStormValueId" TypeName="StormValueBLL"
DeleteMethod="Delete" UpdateMethod="UpdateStormTable">
<DeleteParameters>
<asparameter Name="stormValueid" Type="Int32" />
</DeleteParameters>
<SelectParameters>
<asp:SessionParameter Name="id"
SessionField="stormValueId" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
EnableViewState="False" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlAssetType"
EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</div>
<br />
</asp:Content>
Using VS2005, AJAX toolkit.
I have a page that has 2 update panels on it. The top Updatepanel has a
gridview (gvStormDetail) in it and the bottom one has a details view
(dvInsert).
In gvStormDetail, there's a textbox in a column for user input. There's a
button control in this updatepanel for updating this page of gridview rows
all at once.
In dvInsert there's a dropdownlist control that gets updated with values
when the user selects a category type from a dropdown, in this updatepanel,
but outside of the detailsview.
The problem is that when a user changes some text in gvStormDetail and then
hits the Enter Key, a postback occurs and the gridview now shows the first
row as a selected row. Then, if the user clicks the button for updating the
values in this gridview, a message box appears with the following text in
it.
'ddlStormAssetE' has a SelectedValue which is invalid because it does not
exist in the list of items. Parameter name: value
So, I have some questions:
1. Is there a way to keep this postback from occuring when the user hit the
enter key in this textbox inside a row in gvStormDetail?
2. I have not be able to find out the event that's firing and how could I do
that?
3. How can I keep the first row of the gridview from being selected?
Also, this message appears no matter what control is clicked on after this
happens so the page has to be left and come back to before it behaves
correctly again. I'll post the html source if it might help.
<%@ Page Language="VB" MasterPageFile="~/Master/GISMasterPage.master"
AutoEventWireup="false" CodeFile="StormDetails.aspx.vb"
Inherits="Public_StormDetails" title="Storm Edit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent"
Runat="Server">
<aspanel ID="pnlHeader" runat="server" EnableViewState="False"
HorizontalAlign="Center"
Width="100%">
<aspetailsView ID="dvHeader" runat="server"
AutoGenerateRows="False" DataKeyNames="CntyAssetID"
DataSourceID="dsHeader" SkinID="dvplainSkin" Width="328px">
<Fields>
<asp:BoundField DataField="CntyAssetID" HeaderText="County
Asset ID" InsertVisible="False"
ReadOnly="True" SortExpression="CntyAssetID">
<HeaderStyle Font-Bold="True" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="Name" HeaderText="Name"
SortExpression="Name">
<HeaderStyle Font-Bold="True" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="Bkpg" HeaderText="Book page"
SortExpression="Bkpg">
<HeaderStyle Font-Bold="True" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="TotalValue"
DataFormatString="{0:C0}" HeaderText="Total Value"
HtmlEncode="False" SortExpression="TotalValue">
<HeaderStyle Font-Bold="True" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="RecordingDate"
DataFormatString="{0:MM/dd/yyyy}" HeaderText="Recording Date"
HtmlEncode="False" SortExpression="RecordingDate">
<HeaderStyle Font-Bold="True" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
</Fields>
<HeaderStyle Font-Bold="False" />
</aspetailsView>
<asp:ObjectDataSource ID="dsHeader" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetBundleHeaderById" TypeName="BundleHeaderBLL">
<SelectParameters>
<asp:SessionParameter Name="id" SessionField="cntyAssetId"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</aspanel>
<br />
<br />
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div id="gridviewDiv" runat="server" style="border-color:#EFEFEF;
border-style:solid; border-width:2px">
<asp:UpdatePanel ID="UpdatePanel1" runat="server"
EnableViewState="False">
<ContentTemplate>
<asp:GridView ID="gvStormDetail"
runat="server"
AutoGenerateColumns="False"
DataSourceID="dsStormDetail"
EnableViewState="False"
SkinID="gridviewSkin"
Width="672px"
DataKeyNames="StormValueID"
AllowSorting="True">
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:ImageButton ID="lbEdit"
runat="server"
CausesValidation="False"
CommandName="Select"
ImageUrl="~/Images/edit_white2.gif"
CommandArgument="EditMe" EnableViewState="False">
</asp:ImageButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:ImageButton ID="lbDelete"
runat="server"
CausesValidation="False"
CommandName="Delete"
OnClientClick="return confirm('Are you sure
you want to delete this Storm Record?');"
ImageUrl="~/Images/Delete.gif"
ToolTip="Delete this record permanently"
EnableViewState="False">
</asp:ImageButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="hlMap" runat="server"
Target="_map">Map</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="StormValueID"
HeaderText="StormValueID" InsertVisible="False"
ReadOnly="True" SortExpression="StormValueID"
Visible="False" />
<asp:BoundField DataField="StormAssetType"
HeaderText="Asset Category" SortExpression="StormAssetType" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="StormAssetTypeID"
HeaderText="StormAssetTypeID" SortExpression="StormAssetTypeID"
Visible="False" />
<asp:TemplateField HeaderText="Storm Asset Name"
SortExpression="StormAssetName">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server"
Text='<%# Bind("StormAssetName") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("StormAssetName") %>' Width="200px"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="StmFacilityClkID"
SortExpression="StmFacilityClkID">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server"
Text='<%# Bind("StmFacilityClkID") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblStmFacilityClkId"
runat="server" Text='<%# Bind("StmFacilityClkID") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Description"
SortExpression="Description">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server"
Text='<%# Bind("Description") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblDescription" runat="server"
EnableViewState="False" Height="24px"
Text='<%# Bind("Description") %>'
Width="232px"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Estimated Value"
SortExpression="EstValue">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Bind("EstValue") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblEstValue" runat="server"
Text='<%# Bind("EstValue", "{0:C0}") %>'></asp:Label>
<asp:TextBox ID="txtEstValue" runat="server"
EnableViewState="False" Text='<%# Bind("EstValue", "{0:C0}") %>'
Visible="False" Width="96px"
OnTextChanged="txtEstValue_TextChanged"></asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField DataField="CntyAssetID"
HeaderText="CntyAssetID" SortExpression="CntyAssetID"
Visible="False" />
<asp:TemplateField></asp:TemplateField>
<asp:BoundField DataField="ModUser" HeaderText="ModUser"
SortExpression="ModUser">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="ModDate"
DataFormatString="{0:MM/dd/yyyy}" HeaderText="ModDate"
HtmlEncode="False" SortExpression="ModDate">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
</Columns>
</asp:GridView>
<br />
<asp:ObjectDataSource ID="dsStormDetail" runat="server"
SelectMethod="GetStormAssetsByCntyAssetdId"
TypeName="StormAssetsMainBLL"
EnableViewState="False"
DeleteMethod="Delete">
<SelectParameters>
<asp:SessionParameter Name="id"
SessionField="cntyAssetId" Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asparameter Name="stormValueId" Type="Int32" />
</DeleteParameters>
</asp:ObjectDataSource>
<table id="tblTotalValue" style="font-family:Arial;
font-size:10pt" width="100%">
<tr>
<td style="width:25%">
<asp:Label ID="lblTotalLabel" runat="server"
Font-Names="Arial" Font-Size="10pt"
Text="Total Estimated Value:"
Width="168px"></asp:Label></td>
<td style="width:25%"></td>
<td style="width:25%"></td>
<td style="width:25%">
<asp:Label ID="lblTotal" runat="server"
Font-Names="Arial" Font-Size="10pt" Text="Total Value:"
Width="96px"></asp:Label></td>
</tr>
</table>
<br />
<asp:Button ID="btnUpdate" runat="server"
EnableViewState="False"
Text="Save Changes" OnClick="btnUpdate_Click"
CausesValidation="False" ToolTip="Saves your Estimated Value changes"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="dvStormInsert"
EventName="ItemInserting" />
</Triggers>
</asp:UpdatePanel>
</div>
<br />
<br />
<div>
<br />
<asp:UpdatePanel ID="upInsert" runat="server"
UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblAssetType" runat="server"
EnableViewState="False" Font-Size="10pt"
Text="Category" Width="104px" BackColor="#EFEFEF"
Height="18px"></asp:Label><aspropDownList ID="ddlAssetType" runat="server"
AutoPostBack="True"
DataSourceID="dsAssetTypes"
DataTextField="StormAssetType"
DataValueField="StormAssetTypeID"
Width="236px" EnableViewState="False">
</aspropDownList>
<asp:ObjectDataSource ID="dsAssetTypes" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetAssetTypesPlusNone"
TypeName="StormAssetTypeBLL"
EnableViewState="False">
</asp:ObjectDataSource>
<br />
<aspetailsView ID="dvStormInsert"
runat="server"
DefaultMode="Insert"
EnableViewState="False"
Height="50px"
Width="368px"
SkinID="detailsviewSkin"
AutoGenerateRows="False"
DataKeyNames="StormValueID"
DataSourceID="dsStormInsert" >
<Fields>
<asp:TemplateField HeaderText="StormValueID"
InsertVisible="False" SortExpression="StormValueID">
<EditItemTemplate>
<asp:Label ID="lblStormValueId" runat="server"
Text='<%# Eval("StormValueID") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%#
Bind("StormValueID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CntyAssetID"
SortExpression="CntyAssetID">
<EditItemTemplate>
<asp:Label ID="lblCntyAssetId" runat="server"
Text='<%# Eval("CntyAssetID") %>' Width="184px"></asp:Label>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtCntyAssetId" runat="server"
Enabled="False" EnableViewState="False"
Text='<%# Bind("CntyAssetID") %>'
Width="230px"></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("CntyAssetID") %>' Width="176px"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Storm Asset"
SortExpression="StormAssetID">
<EditItemTemplate><aspropDownList
ID="ddlStormAssetE"
runat="server"
DataSourceID="dsStormAssetE"
DataTextField="StormAssetName"
DataValueField="StormAssetID"
Width="236px" SelectedValue='<%#
Bind("StormAssetID") %>'>
</aspropDownList><br />
<asp:ObjectDataSource ID="dsStormAssetE"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetStormAssetsByAssetTypeId"
TypeName="StormAssetsBLL">
<SelectParameters>
<asp:ControlParameter
ControlID="ddlAssetType"
Name="id"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</EditItemTemplate>
<InsertItemTemplate>
<aspropDownList ID="ddlStormAsset"
runat="server"
DataSourceID="dsStormAsset"
DataTextField="StormAssetName"
DataValueField="StormAssetID"
Width="236px" EnableViewState="False">
</aspropDownList>
<asp:ObjectDataSource ID="dsStormAsset"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetStormAssetsByAssetTypeId"
TypeName="StormAssetsBLL">
<SelectParameters>
<asp:ControlParameter
ControlID="ddlAssetType"
Name="id"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("StormAssetID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Description"
SortExpression="Description">
<EditItemTemplate>
<asp:TextBox ID="txtDescriptionE" runat="server"
EnableViewState="False" Text='<%# Bind("Description") %>'
TextMode="MultiLine"
Width="230px"></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtDescription" runat="server"
Text='<%# Bind("Description") %>' EnableViewState="False"
TextMode="MultiLine" Width="230px"></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%#
Bind("Description") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estimated Value"
SortExpression="EstValue">
<EditItemTemplate>
<asp:TextBox ID="txtEstValueE" runat="server"
Text='<%# Bind("EstValue") %>' Width="230px"></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtEstValue" runat="server"
Text='<%# Bind("EstValue") %>' Width="230px"></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%#
Bind("EstValue") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="StmFacilityClkID"
SortExpression="UniqueID">
<EditItemTemplate>
<asp:TextBox ID="txtUniqueIdE" runat="server"
Text='<%# Bind("StmFacilityClkID") %>'
Width="230px"></asp:TextBox><asp:RequiredFieldValidator
ID="rfvUniqueIdE" runat="server"
ControlToValidate="txtUniqueIdE"
EnableViewState="False" ErrorMessage="StmFacilityClkID is a required field"
EnableClientScript="False">*</asp:RequiredFieldValidator>
<asp:CustomValidator ID="cvStmFacilityClkIdE"
runat="server" ControlToValidate="txtUniqueIdE"
ErrorMessage="StmFacilityClkID is not valid"
EnableViewState="False"
OnServerValidate="ServerValidateID">*</asp:CustomValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtUniqueId" runat="server"
Text='<%# Bind("StmFacilityClkID") %>'
Width="230px"></asp:TextBox><asp:RequiredFieldValidator ID="rfvUniqueId"
runat="server" EnableViewState="False"
ErrorMessage="StmFacilityClkID is a required
field" ControlToValidate="txtUniqueId" Display="Dynamic"
EnableClientScript="False">*</asp:RequiredFieldValidator>
<asp:CustomValidator ID="cvStmFacilityClkIdI"
runat="server"
ControlToValidate="txtUniqueId"
EnableViewState="False" ErrorMessage="StmFacilityClkID is not valid"
OnServerValidate="ServerValidateID">*</asp:CustomValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%#
Bind("StmFacilityClkID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<InsertItemTemplate>
<asp:LinkButton ID="lbInsert" runat="server"
CausesValidation="True"
CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="lbCancel" runat="server"
CausesValidation="False"
CommandName="Cancel"
OnClick="lbCancel_Click"
Text="Cancel"></asp:LinkButton>
</InsertItemTemplate>
<ItemTemplate>
</ItemTemplate>
</asp:TemplateField>
</Fields>
</aspetailsView>
<asp:ObjectDataSource ID="dsStormInsert" runat="server"
EnableViewState="False" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetStormValueByStormValueId" TypeName="StormValueBLL"
DeleteMethod="Delete" UpdateMethod="UpdateStormTable">
<DeleteParameters>
<asparameter Name="stormValueid" Type="Int32" />
</DeleteParameters>
<SelectParameters>
<asp:SessionParameter Name="id"
SessionField="stormValueId" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
EnableViewState="False" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlAssetType"
EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</div>
<br />
</asp:Content>