Sietse Wijnker wrote:
Hi Paul,
Your headers get 'out of sync'. What exactly do you mean with that?
Do the captions get all <elmar fud mode>skweawy</elmar fud mode>, or does
the handling of the click/rightclick.
No - the column data gets moved but no linger has the correct heading.
But reading the rest of your reply has given me some more ideas on what
to look for and where to look for the cause of the problem. And I can
at least get rid of the RemoveObject/AddObject stuff using the
HeaderClass and HeaderClassLibrary approach.
Many thanks
If it's the latter, It's probably due to a coding-problem in the HeaderClick
method. Do you do anything with the this-reference that's get passed except
for the toHeader.Parent.ColumnOrder?
The columnorder is indeed out-of-sync with the coulumn index number in the
grid's columns collection. Perhaps that's where you have a mismatch?
Regards,
Sietse Wijnker
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Newton
Sent: vrijdag 27 oktober 2006 1:17
To: [EMAIL PROTECTED]
Subject: VFP9 - Problem moving columns in grid with custom headers
Hi all
I have a simple custom header class:
DEFINE CLASS gridheader AS Header
PROCEDURE Click
THISFORM.HeaderClick(THIS,"L")
ENDPROC
PROCEDURE RightClick
THISFORM.HeaderClick(THIS,"R")
ENDPROC
ENDDEFINE
I have a grid which starts off with column count = -1 and
then I have the following code:
.Grid1.RecordSource = "IndexTable"
FOR EACH loColumn IN .Grid1.Columns
lcCaption = loColumn.Header1.Caption
loColumn.RemoveObject("Header1")
loColumn.AddObject( 'Header1', 'gridheader' )
loColumn.Header1.Caption = lcCaption
ENDFOR
Now all this works fine and when I click or right click on
any of the headers the code in "THISFORM.HeaderClick"
executes. A problem arises however when I move columns in
the grid by holding down the left mouse button and dragging -
sure the column moves but the columns and headers get all out
of synch !
Any suggestions ?
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.