DEVExpress GridControl数据源是List<T> 或 DataTable读取单元格里面的值

来源:互联网 发布:淘宝卖爱奇艺会员 编辑:程序博客网 时间:2024/05/17 06:32

如果数据源是DataTable获取单元格里面的值

this.GridControl.DataSource=DataTable

int rowHandle=this.GridView.FocusedHandle;

DataRow dr=this.GridView.GetDataRow(rowHandle);

string id=dr["ID"].toString();


如果数据源是List<T>获取单元格里面的值

this.GridControl.DataSource=List<T>

int rowHandle=this.GridView.FocusedHandle;

string id=this.GridView.GetRowCellValue(rowHandle,"Id").toString();



阅读全文
0 0
原创粉丝点击