DevExpress 记录点滴 之 RepositoryItem
1.CheckEdit
private void repositoryItemCheckEdit1_QueryCheckStateByValue(object sender, DevExpress.XtraEditors.Controls.QueryCheckStateByValueEventArgs e) { string val = ""; if (e.Value != null) { val = e.Value.ToString(); } else { val = "False";//默认为不选 } switch (val) { case "True": case "Yes": case "1": e.CheckState = CheckState.Checked; break; case "False": case "No": case "0": e.CheckState = CheckState.Unchecked; break; default: e.CheckState = CheckState.Checked; break; } e.Handled = true; }
2.判断是否选中(上层控件的值来判断)
2.1 Barmanager中
if(barEditItem3.EditValue!=null) MessageBox.Show(barEditItem3.EditValue.ToString());
2.2 GridView
this.gridView1.GetRowCellValue(i, "字段")
2. TextEdit(repositoryItemTextEdit1)
sender as DevExpress.XtraEditors.TextEdit