Home Forums WPF controls Xceed DataGrid for WPF ListView column drag/resize events?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26047 |

    I know, I know – this is a WPF grid forum, but you guys are the best bet for asking this – I can’t seem to find any event (except MouseUp/MouseDown) that is fired when a listview column is dragged/resized. I need it to persist the listview column layout when it is changed. Anybody solved a similar problem?

    Imported from legacy forums. Posted by Sergey (had 2697 views)

    User (Old forums)
    Member
    Post count: 23064

    I would assume that the property values you are interested in are DependencyProperties so the method to solve this is to hook into the DP change notification for the properties you are interested in and react accordingly. I have not used it with ListView but I have used it with the Xceed Grid.

    DependencyPropertyDescriptor ColumnWidthPropertyDescriptor =
    DependencyPropertyDescriptor.FromProperty(Column.WidthProperty, typeof(Column));
    ColumnWidthPropertyDescriptor.AddValueChanged(column, new EventHandler(ColumnWidthChangedHandler));

    Imported from legacy forums. Posted by Derek (had 588 views)

    User (Old forums)
    Member
    Post count: 23064

    Great, thanks!
    I’ve figured out already that I can use a dependency property notification for Width, but I was going to create bindings – using the DependencyPropertyDescriptor makes it much simplier!

    As of column order change, it is even easier – columns are an ObservableCollection, so the CollectionChanged is fired every time a column is added/removed or moved.

    Imported from legacy forums. Posted by Sergey (had 3897 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.