在使用LookUpEdit作为下拉选择框时,若我们想得到选中行的数行,可用如下代码
/// gridLookUpEdit1InstrumentIDA是LookUpEdit的名称
///
DataRow dr = gridLookUpEdit1InstrumentIDA.Properties.View.GetFocusedDataRow();
/// 读取数据行的"ExchangeID", "ConID"数据列
textEdit2ExchangeIDA3.Text = dr["ExchangeID"].ToString()
textEdit3ConIDA3.Text = dr["ConID"].ToString();
这样,就可以把选中行整行的数据提取到变量dr中,供程序使用
示例代码的列“ExchangeID", "ConID", 是LookUpEdit数据源的列