我尝试从选定的gridview行获取值,但是我从行获得了值,这在gridview中更高。我认为这是计数器的问题,但我找不到它。
C#
protected void GridView1_SelectedIndexChanged1(object sender, EventArgs e)
m = GridView1.SelectedRow.Cells[5].Text;
ASP
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" OnDataBound="GridView1_SelectedIndexChanged" Width="490px" AllowSorting="True" OnSelectedIndexChanged="GridView1_SelectedIndexChanged1" EditIndex="5" SelectedIndex="0" CellPadding="0" CellSpacing="0" DataKeyNames="Idoferty">