B
Bob
Hi,
I want to get the value of a particular field ("ID") of the selected row in
a gridview.
Here my code:
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" />
<Columns>
<asp:CommandField ShowSelectButton="True" SelectText="Preview" />
<asp:BoundField DataField="id" HeaderText="id" SortExpression="id"
ReadOnly="True"/>
<asp:BoundField DataField="titel" HeaderText="titel"
SortExpression="titel"/>
</Columns>
</asp:GridView>
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles GridView1.SelectedIndexChanged
Dim vldna As String
vldna = GridView1.Controls.Item(1).ToString
End Sub
But i get the error:
Specified argument was out of the range of valid values.
Parameter name: index
Thanks for help
Bob
I want to get the value of a particular field ("ID") of the selected row in
a gridview.
Here my code:
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" />
<Columns>
<asp:CommandField ShowSelectButton="True" SelectText="Preview" />
<asp:BoundField DataField="id" HeaderText="id" SortExpression="id"
ReadOnly="True"/>
<asp:BoundField DataField="titel" HeaderText="titel"
SortExpression="titel"/>
</Columns>
</asp:GridView>
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles GridView1.SelectedIndexChanged
Dim vldna As String
vldna = GridView1.Controls.Item(1).ToString
End Sub
But i get the error:
Specified argument was out of the range of valid values.
Parameter name: index
Thanks for help
Bob