I have a DetailsView which is inside of a FormView. I lifted this
DetailsView straight off another one of my pages, where it was working
beautifully. Now I get this endlessly frustrating error message
whenever I try to go into Edit mode:
Specified argument was out of the range of valid values.
Parameter name: index
The DetailsView is actually inside an UpdatePanel, which is inside an
Ajax Accordion, which is inside the FormView. Could possibly be this,
but my Insert and my ReadOnly templates work perfectly.
I started stripping it down (it was pretty complex) but I have the
same results. Here's the code for my DetailsView and my SqlDataSource.
I took everything out of my DetailsView except for the Edit button and
1 field. Like I said, both other templates work fine:
<asp:SqlDataSou rce ID="dsSpecificI nj" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:Conn_String %>"
SelectCommand=" a valid select statement">
<SelectParamete rs>
<asp:QueryStrin gParameter Name="CINJ_ID"
QueryStringFiel d="CINJ_ID" Type="string" />
</SelectParameter s>
<InsertParamete rs>
<asp:QueryStrin gParameter QueryStringFiel d="CINJ_id"
Name="CINJ_ID" Type="String" />
<asp:SessionPar ameter SessionField="U sername"
Name="CREATED" Type="String" />
</InsertParameter s>
<UpdateParamete rs>
<asp:SessionPar ameter SessionField="U sername"
Name="UPDATED" Type="String" />
</UpdateParameter s>
</asp:SqlDataSour ce>
<asp:DetailsVie w ID="dvInjury" runat="server" Width="100%"
DataKeyNames="C INJ_ID"
DataSourceID="d sSpecificInj" DefaultMode="Re adOnly" EmptyDataText=" No
current record."
AutoGenerateRow s="false">
<FieldHeaderSty le VerticalAlign=" Top" Width="20%" Font-Bold="true" />
<FooterStyle BackColor="Alic eBlue" HorizontalAlign ="Center" />
<FooterTemplate >
<asp:Button ID="btnEdit" runat="server" Text="Edit This Injury"
CommandName="Ed it"></asp:Button>
</FooterTemplate>
<RowStyle HorizontalAlign ="Left" />
<Fields>
<asp:BoundFie ld DataField="CINJ _DT" />
</Fields>
</asp:DetailsView >
Any help would be appreciated.
DetailsView straight off another one of my pages, where it was working
beautifully. Now I get this endlessly frustrating error message
whenever I try to go into Edit mode:
Specified argument was out of the range of valid values.
Parameter name: index
The DetailsView is actually inside an UpdatePanel, which is inside an
Ajax Accordion, which is inside the FormView. Could possibly be this,
but my Insert and my ReadOnly templates work perfectly.
I started stripping it down (it was pretty complex) but I have the
same results. Here's the code for my DetailsView and my SqlDataSource.
I took everything out of my DetailsView except for the Edit button and
1 field. Like I said, both other templates work fine:
<asp:SqlDataSou rce ID="dsSpecificI nj" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:Conn_String %>"
SelectCommand=" a valid select statement">
<SelectParamete rs>
<asp:QueryStrin gParameter Name="CINJ_ID"
QueryStringFiel d="CINJ_ID" Type="string" />
</SelectParameter s>
<InsertParamete rs>
<asp:QueryStrin gParameter QueryStringFiel d="CINJ_id"
Name="CINJ_ID" Type="String" />
<asp:SessionPar ameter SessionField="U sername"
Name="CREATED" Type="String" />
</InsertParameter s>
<UpdateParamete rs>
<asp:SessionPar ameter SessionField="U sername"
Name="UPDATED" Type="String" />
</UpdateParameter s>
</asp:SqlDataSour ce>
<asp:DetailsVie w ID="dvInjury" runat="server" Width="100%"
DataKeyNames="C INJ_ID"
DataSourceID="d sSpecificInj" DefaultMode="Re adOnly" EmptyDataText=" No
current record."
AutoGenerateRow s="false">
<FieldHeaderSty le VerticalAlign=" Top" Width="20%" Font-Bold="true" />
<FooterStyle BackColor="Alic eBlue" HorizontalAlign ="Center" />
<FooterTemplate >
<asp:Button ID="btnEdit" runat="server" Text="Edit This Injury"
CommandName="Ed it"></asp:Button>
</FooterTemplate>
<RowStyle HorizontalAlign ="Left" />
<Fields>
<asp:BoundFie ld DataField="CINJ _DT" />
</Fields>
</asp:DetailsView >
Any help would be appreciated.