DevExpress::XtraBars::BarEditItem获取EditValue值事件

 

 1 //视图设计器中拖动一个barManager,添加一个bar,再添加一个BarEditItem控件,如下代码:

 2 

 3  private:  DevExpress::XtraEditors::Repository::RepositoryItemCheckEdit^  repositoryItemCheckEdit2;

 4  private: DevExpress::XtraBars::BarEditItem^  biIsOR;

 5 
6 7 8 // 9 // biIsOR 10 // 11 this->biIsOR->Caption = L"OR"; 12 this->biIsOR->Edit = this->repositoryItemCheckEdit2; 13 this->biIsOR->EditValue = false; 14 15 16 // 为biIsOR的Edit添加一个EditValueChanging事件,该事件捕获CheckEditValue。
17 // repositoryItemCheckEdit2 18 // 19 this->repositoryItemCheckEdit2->AutoHeight = false; 20 this->repositoryItemCheckEdit2->Name = L"repositoryItemCheckEdit2"; 21 this->repositoryItemCheckEdit2->ValueChecked = true ; 22 this->repositoryItemCheckEdit2->EditValueChanging += gcnew DevExpress::XtraEditors::Controls::ChangingEventHandler(this, &myOpenFilterDlg::repositoryItemCheckEdit2_EditValueChanging); 23
 

奇怪的是,    (bool)biIsOR->EditValue     并不能捕获当前Value值,

所以在biIsOR或者repositoryItemCheckEdit2 中添加:Click事件,CheckedEditChanged事件,EditValueChanged事件等都不能捕获,

并且也没有e->NewValue属性;

需要通过    repositoryItemCheckEdit2  中添加EditValueChanging事件,

通过 e->NewValue      获取当前值,e->OldValue       获取之前的值;

DevExpress::XtraBars::BarEditItem获取EditValue值事件

DevExpress::XtraBars::BarEditItem获取EditValue值事件

你可能感兴趣的:(DevExpress)