We're working with the WPF DataGrid and I have a question about dragging column headers:
The grid lets the user rearrange the columns, by dragging the column header left or right. So far, so good.
But, sometimes we have many columns, and only the first few columns are visible; so there is a horizontal scrollbar. In such case, if the user drags a column header to the right edge of the DataGrid window, I want the DataGrid to scroll, automatically,
one column at a time. Is there an easy way to do that?
(To be clear: yes, the user can already scroll horizontally by interacting with the horizontal scrollbar, but that isn't what I'm asking about. I'm asking if the "drag a column header left or right" gesture can cause the DataGrid to scroll
left or right.)
I guess I could handle various low-level events, but it seems like it shouldn't be necessary -- DataGrid has so much functionality built-in, that I'm guessing it already has the ability to scroll when the user drags the column header to the edge.
So, is there either (a) a property that I can set, to tell the DataGrid to scroll when the user drags a column header to the edge of the window; or (b) a code example showing how to achieve this effect myself?
View Complete Post