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

 

posted @ 2013-10-06 16:23  永远的菜鸟@me  阅读(1820)  评论(0编辑  收藏  举报