DevExpress GridView获取选中行某列的值

不废话,直接上代码

int selectedHandle;
selectedHandle = this.gridView1.GetSelectedRows()[0];
MessageBox.Show(this.gridView1.GetRowCellValue(selectedHandle, "RoadName").ToString());

 

或者:

string str = this.gridView1.GetRowCellValue(this.gridView1.GetSelectedRows()[0], "RoadName").ToString();

 

或者:

string str = this.gridView1.GetRowCellValue(this.gridView1.GetSelectedRows()[0], gridView1.Columns["RoadName"]).ToString();

 

 

上一篇:devexpress开发笔记


下一篇:【Devexpress】Gridcontorl的列隐藏后再显示位置发生了变化