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

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM