I have two datagrids that have related information. When I resize a column in one grid, I want to set the size of the corresponding column in the other datagrid to be the size of the resized column. This is where my problem starts.
I have used a datagrid.HitTest(e.X, e.Y) in a mouse down event to see if it is a column resize event and then if it is to see which column has been resized. In the mouse down event I get the width of the resized column using:
hti = dgClientWIP.HitTest(e.X, e.Y)
x = hti.column
When I drag the column to the new size and let the mouse up, I display the width of the column again. The size is the same as before I resized the column. It only seems to update the new column width after the mouseup event has completed.
I cannot work out how to get the new value for the column width from any event that fires – I could set a timer to check to see if there has been a column resize event but that seems rather tacky code.
Any ideas gratefully received.