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();


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM