Hello,

Thanks in advance for the help.

How do you detect mouse events in column headings in a grid control?

Suppose you wanted to make clicking in a column heading perform a
select/deselect all toggle. How would you know that the column heading has
been clicked?

Thanks,
Jeff

Re: Detecting Mouse Clicks in Grid Column Headings by Paul

Paul
Thu Mar 30 11:31:03 CST 2006

It's not a heading, it's a header.

Look for the grid.column.header.click method.

You can't "select all rows" in a grid, though. If you want to do that, use a
list box.

But with a grid, you can put something like this in the header.click method:

REPLACE ALL somefield WITH .T. IN mytable




"Jeff Grippe" <jgrippe@hilldun.com> wrote in message
news:122o4g5da0gme4a@news.supernews.com...
> Hello,
>
> Thanks in advance for the help.
>
> How do you detect mouse events in column headings in a grid control?
>
> Suppose you wanted to make clicking in a column heading perform a
> select/deselect all toggle. How would you know that the column heading has
> been clicked?
>
> Thanks,
> Jeff
>



RE: Detecting Mouse Clicks in Grid Column Headings by imaginecorp

imaginecorp
Thu Mar 30 11:59:01 CST 2006

Hello Jeff:

Look up GridHitTest;
Example: the following tests if a record is being deleted in a grid:

LPARAMETERS nButton, nShift, nXCoord, nYCoord
STORE 0 TO nWhere_Out, nRelRow_Out, nRelCol_Out, nView_Out
THIS.GridHitTest(nXCoord,nYCoord,@nWhere_Out)
LOCAL nDeleteAns
nDeleteAns = 0
IF nWhere_Out = 6
IF DELETED()
nDeleteAns = ;
MESSAGEBOX("You are about to delete this record. Are you
sure?",(4+32+256),its_logo)
ENDIF
IF nDeleteAns = 7
RECALL NEXT 1
ENDIF
ENDIF
THIS.REFRESH

Good luck
Mohammed
www.imaginecorp.com/whatwedo.htm

"Jeff Grippe" wrote:

> Hello,
>
> Thanks in advance for the help.
>
> How do you detect mouse events in column headings in a grid control?
>
> Suppose you wanted to make clicking in a column heading perform a
> select/deselect all toggle. How would you know that the column heading has
> been clicked?
>
> Thanks,
> Jeff
>
>
>