You can handle the PreviewMouseUp event to catch the moment when the user clicks on a column header:
[C#]
-
private void view_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) {
-
TableViewHitInfo info = view.CalcHitInfo((DependencyObject)e.OriginalSource);
-
if (info.InColumnHeader) {
-
MessageBox.Show(info.Column.FieldName);
-
}
-
}
1
solution
MouseUp event not firing.
Tags:
.NET, WPF, DXGrid for WPF 0
Victoryking
3 years ago MouseUp event is not firing. we need this for sorting. I read from other post that this is by design and we should use GridControl.CustomColumnSort Event. Our Application architecture is different. A legacy delphi component does sorting of the records. so, I need a proper event to call the sorting methods and re-bind the new data? Also, I need to AllowMove for columns.
any comments?
Show all comments
Dmitry (DevExpress Support)
3 years ago >>Also, I need to AllowMove for columns.
I'm afraid that your requirements are not clear to me. We kindly ask you to create a new ticket regarding this second problem in order not to mix discussions devoted to different subjects in one ticket and avoid misunderstanding. Please describe the problem that you have encountered and the task you wish to implement in greater detail and we will do our best to find an appropriate solution.
Show all comments
Leave a Comment You must log in or register to leave comments 1 Solution0
Dmitry (DevExpress Support)
3 years ago You can handle the PreviewMouseUp event to catch the moment when the user clicks on a column header:
[C#]Open in popup window
- private void view_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) {
-
TableViewHitInfo info = view.CalcHitInfo((DependencyObject)e.OriginalSource);
-
if (info.InColumnHeader) {
-
MessageBox.Show(info.Column.FieldName);
-
}
-
}
This event is raised before the MouseUp and can be handled at the TableView's level.