3

I want to perform some tasks on Checked Event of checkbox column of DevExpress's DataGrid control in wpf.

1
  • Where is the question ? Have you tried something ? Or is this just an information for the world ? Commented Jul 23, 2013 at 13:04

1 Answer 1

1

To track when the value of corresponding boolean colums is changed i suggest you handle the TabbedView.CellValueChanged event:

((TableView)gridControl.View).CellValueChanged += MainWindow_CellValueChanged
//...
void MainWindow_CellValueChanged(object sender, CellValueChangedEventArgs e) {
    if(e.Column.FieldName == "BooleanProp") { 
        // do something
    }
}

To track Checked/Unchecked event directly on cell editor you can use the following approach:

((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
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.