>When a resize event occurs in cgrid, it triggers the header click event, thus changing the index.. is there a way to stop this??
>
>Thanks,
>Dan
Hi Dan.
I have the following properties of grid's header class:
mlColumnMoved = .f. && flag indicating column was moved
mnColumnOrder = 0 && original column order
mlColumnSized = .f. && flag indicating column was resized
mnColumnWidth = 0 && original size of column
In the Click method I check condition if ! .mlColumnMoved and ! .mlColumnSized
And I have this code in MouseDown and MouseUp events:
-------------
procedure mousedown
lparameters nButton, nShift, nXCoord, nYCoord
with this
.mnColumnOrder = this.parent.columnorder
.mnColumnWidth = this.parent.width
endwith
endproc
procedure mouseup
lparameters nButton, nShift, nXCoord, nYCoord
with this
.mlColumnMoved = ( this.parent.columnorder != .mnColumnOrder )
.mlColumnSized = ( this.parent.width != .mnColumnWidth )
endwith
endproc
If it's not broken, fix it until it is.
My Blog