Gridview获取选定值但从较高行接收值

时间:2014-04-24 01:05:39

标签: c# asp.net gridview

我尝试从选定的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">

0 个答案:

没有答案