Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Column in grid
Message
From
24/01/2007 18:46:21
 
 
To
24/01/2007 13:47:00
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01188855
Message ID:
01189005
Views:
9
>Perhaps someone can tell me the best way to do this....
>
>I have a grid that is presented to end users. The grid itself does not contain data that the end user can or should edit. One of the columns in the grid displays an icon depending on the value of a field in the table that it displays.
>
>Currently, the grid is set up so that highlighting a row does not select a single cell within the grid. When the row is double clicked, a form that contains a pagefram opens up for enduser input. Currently, it doesn't matter where one doucble clicks in the row, the same form opens up with row specific data to be edited. I'd like to fix it up so that if the enduser specifically double clicks on the icon in the particular column, that the form opens up, but goes directly to a different page in the pageframe. I still want the grid row to be uneditable, and for the cells in the grid to be unselectable individually (act like a list box, and highlight the whole row).
>
>Thoughts?
>
>C

in the grid's mousedown event you can detect the mouse position ; then using the column widths calculate which column was clicked and pass that (via grid's tag property?) to the dblClick event

something like (untested)
LPARAMETERS nButton, nShift, nXCoord, nYCoord
m.lnStartPos = THIS.LEFT
FOR nCol=1 TO THIS.COLUMNCOUNT
	m.lnStartPos = m.lnStartPos+ THIS.COLUMNS(nCol).WIDTH
	IF nXCoord < m.lnStartPos
		EXIT
	ENDIF
NEXT i
THIS.TAG = STR(nCol)  && where dblClick() can find it
hth

Nigel
Previous
Reply
Map
View

Click here to load this message in the networking platform