Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1500
SelectionDrag event with HeaderClickAction set to SortMulti
posted

Hi,

I need to handle the UltraGrid.SelectionDrag event. The HeaderClickAction (UltraGrid.DisplayLayout.Override.HeaderClickAction) property is set to SortMulti. The SelectionDrag event is not raised when I start dragging a column. However when I change HeaderClickAction to "Select" the event starts raising.

Why is that? Is there I way the SelectionDrag event is raised when I start dragging a column, when HeaderClickAction event is set to SortMulti?

Thanks,

Vitaly 

Parents
No Data
Reply
  • 469350
    Offline posted

     Hi Vitaly,

        I don't think these two settings are compatible. When the user mouses down on the header, how would the grid know whether to change the sorting or if a drag operation was about to begin? Even if you started the drag, it would be too late, the column would have been sorted already, which would be strange for your users. 

        SelectionDrag is tied to selection. If your HeaderClickAction is sorting, then no selection takes place and thus no dragging.

        I guess one thing you could do is turn off sorting, and then trap for the MouseUp event of the grid. You could check for a column header at the current position of the mouse and if it's inside a column header, you could toggle the SortIndicator on the column header yourself. That way you could perhaps do both. The only tricky part would be using the UIElements to determine the column header, but this is easy enough once you know how. Check the Infragistics Knowledge Base and do a search for ElementFromPoint. There are lots of articles on this technique. 

Children