10617 : How do I determine when a user has changed the width of a column?

Question

How do I determine when a user has changed the width of a column? I need to save column widths when they have been changed but since the columnwidthchanged event fires continuously during column dragging it is not really helpful in determining the final width (and I don’t want to update the database multiple times during a column sizing operation)..

Answer

It seems like a bug if the ColumnWidthChanged is fired all the time while moving and there is no way to detect if the move is still in progress.

A workaround is to set a variable called myColumnWidthChanged to true in that event and implement OnGridMouseUp and check if the variable is set, if so act. Also remember to reset the myColumnWidthChanged variable to false in the OnGridMouseUp.

 

Leave a Reply