其他分享
首页 > 其他分享> > DevExpress GridView获取选中行某列的值

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

 

 

标签:GridView,某列,RoadName,DevExpress,GetSelectedRows,GetRowCellValue,selectedHandle,T
来源: https://www.cnblogs.com/east115/p/14876740.html