3
我想在wpf中的DevExpress的DataGrid控件的複選框列的Checked Event上執行一些任務。在wpf中檢查DevExpress的DataGrid控件的複選框列的事件
我想在wpf中的DevExpress的DataGrid控件的複選框列的Checked Event上執行一些任務。在wpf中檢查DevExpress的DataGrid控件的複選框列的事件
要跟蹤時,對應的布爾柱的側向承載力值改變我建議你處理TabbedView.CellValueChanged事件:
((TableView)gridControl.View).CellValueChanged += MainWindow_CellValueChanged
//...
void MainWindow_CellValueChanged(object sender, CellValueChangedEventArgs e) {
if(e.Column.FieldName == "BooleanProp") {
// do something
}
}
以跟蹤託運直接上,你可以用下面的辦法格編輯器/未檢查的事件:
((TableView)gridControl.View).ShownEditor += TableView_ShownEditor;
((TableView)gridControl.View).HiddenEditor += TableView_HiddenEditor;
//...
void TableView_ShownEditor(object sender, EditorEventArgs e) {
if(e.Column.FieldName == "BooleanProp") {
((DevExpress.Xpf.Editors.CheckEdit)e.Editor).Checked += BooleanPropCheckEdit_Checked;
((DevExpress.Xpf.Editors.CheckEdit)e.Editor).Unchecked += BooleanPropCheckEdit_Unchecked;
}
}
void TableView_HiddenEditor(object sender, EditorEventArgs e) {
if(e.Column.FieldName == "BooleanProp") {
((DevExpress.Xpf.Editors.CheckEdit)e.Editor).Checked -= BooleanPropCheckEdit_Checked;
((DevExpress.Xpf.Editors.CheckEdit)e.Editor).Unchecked -= BooleanPropCheckEdit_Unchecked;
}
}
void BooleanPropCheckEdit_Checked(object sender, RoutedEventArgs e) {
// do something
}
void BooleanPropCheckEdit_Unchecked(object sender, RoutedEventArgs e) {
// do something
}
問題在哪裏?你嘗試過什麼嗎?或者這只是一個世界的信息? – Fares