int i = e.NewEditIndex;//第i行
string sss = GridView1.Rows[i].Cells[3].Text;//该行第3格的值

解决方案 »

  1.   

    遍历Gridview所有行,取每行 control的ID 与DropDownList.ID比较试试
      

  2.   

    protected void Ddl_SelectedIndexChanged(object sender, EventArgs e)
        {
            string index = 根本就没有e.NewEditIndex 这项
            
        }
      

  3.   

    直接取GridView1.SelectedIndex不行吗?
      

  4.   

    if (e.Row.RowIndex == GridView1.EditIndex)
    加层判断
      

  5.   

    lz我只在DataGrid里做过这个,先要找到DropDownList的ID,再与Gridview的html源码比较
    DropDownList dl=(DropDownList)sender;
    string id=dl.UniqueID;
    //比如DataGrid1:_ctl2:list1  这里ctl2就表示了其行位置
      

  6.   

    可以這樣
    <asp:DropDownList ID="drpGname" runat="server" Index="<%# ((GridViewRow)Container).RowIndex %>" </asp:DropDownList>
    自己在前台加Index
    后台這樣取(事件里)
    DropDownList drp = (DropDownList)sender;
    int Index = Convert.ToInt32(drp.Attributes["Index"]);
      

  7.   

    LZ解決了問題都不給分的
    失望ing...
      

  8.   

    http://blog.csdn.net/cyb350623/archive/2007/05/13/1606623.aspx
      

  9.   

    <asp:DropDownList ID="drpGname" runat="server" Index="<%# ((GridViewRow)Container).RowIndex %>" </asp:DropDownList>========此方法有点 HACK ^_^// .aspx
    <asp:TemplateField>
                    <ItemTemplate>
                        <asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
                        </asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
    // .aspx.cs
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList drp = sender as DropDownList;
            GridViewRow row = drp.NamingContainer as GridViewRow; // GridView 中对应的行
            int id = (int)GridView1.DataKeys[row.RowIndex].Value;
            // ...
        }