C# Dev GridView当前行

 DEV获取GridControl当前行

//直接通过gridView获取当前行
dr=this.gridView1.GetDataRow(this.gridView1.FocusedRowHandle);
//通过DataSet获取数据,需要转换行标
dr = ds.Tables[0].Rows[this.gridView1.ViewRowHandleToDataSourceIndex(e.FocusedRowHandle)];
//通过数据绑定获取
gridcontrol1.DataSource = dt;
dr = ds.Tables[0].Rows[dt.Position];

int selectRow = gridView1.GetSelectedRows()[0];
 string id = this.gridView1.GetRowCellValue(selectRow, "id").ToString();
凡哥,别他妈吹牛逼了
原文地址:https://www.cnblogs.com/sdlz/p/14744833.html