如果你的数据源是DataView
可以用
yourDataView[yourDataGrid.CurrentRowIndex]
这个就是DataGrid当前行的数据
DataRowView类型的

解决方案 »

  1.   

    private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
    {
    e.Item.Attributes.Add("onclick","window.open('WebForm2.aspx?ZoneNo="+e.Item.Cells[1].Text+"')");

    e.Item.Attributes.Add("onMouseOver","this.style.backgroundColor='#000000'; this.style.cursor='hand';");
     e.Item.Attributes.Add("onMouseOut","this.style.backgroundColor='#ffffff';");  
    }
      

  2.   

    假设ds.Tables[0]是dataGrid1的数据源
    string f1=ds.Tables[0].Rows[dataGrid1.CurrentRowIndex]["f1"].ToString();