从Devexpress控件中的GridControl获取指定行列的值

tech2023-07-07  95

int row_id = (grcImpStatis.MainView as ColumnView).FocusedRowHandle;//通过光标获取指定行号 public void InitData(object datasource,int row_id) { try { DataTable dt = (DataTable)datasource; userTE.EditValue = dt.Rows[row_id]["User"]; dateDE.EditValue = dt.Rows[row_id]["ExtractTime"]; typeTE.EditValue = dt.Rows[row_id]["CatalogType"]; areaTE.EditValue = dt.Rows[row_id]["SheetArea"]; fftypeTE.EditValue = dt.Rows[row_id]["Type"]; useunitTE.EditValue = dt.Rows[row_id]["Accept"]; functionTE.EditValue = dt.Rows[row_id]["Uses"]; } catch (Exception) { DevExpress.XtraEditors.XtraMessageBox.Show("有错误","提示!"); } }

 

最新回复(0)