2013-07-23 55 views

回答

1

要跟蹤時,對應的布爾柱的側向承載力值改變我建議你處理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 
}