Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP7 - Empty grids can't get focus?
Message
From
31/10/2001 11:58:12
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
31/10/2001 10:08:26
John Deupree
Long Term Care Authority
Tulsa, Oklahoma, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00575466
Message ID:
00575706
Views:
21
Elyse,
If it's returning column then there is something wrong page getting click (grid enabled = .f., when returning .f. ?). Here is a more generic version that frees you from also knowing the grid name (John for header click catch I embedded GridHitTest usage in code) - directly using loObj.parent might be dangerous :
loGrid = .Null.
loObj = Sys(1270)
If Upper(loObj.BaseClass) # 'GRID' And Type('loObj.Parent')='O'
  Do While Type('loObj.Parent')='O'
    loObj = loObj.Parent
    If Upper(loObj.BaseClass) = 'GRID'
      loGrid = loObj
      Exit
    Endif
  Enddo
Else
  loGrid =loObj
Endif

If !Isnull(loGrid) && Found a grid
  Store 0 To lnWhere, lnRelRow, lnRelCol,lnPanel
  loGrid.GridHitTest(Mcol(Wontop(),3),Mrow(Wontop(),3), ;
        @lnWhere,@lnRelRow,@lnRelCol,@lnPanel)
  If lnWhere = 1 && Header
    Wait Window 'Header of relative column '+Transform(lnRelCol) TIMEOUT 2
  Endif
  loGrid.RightClick() && Elyse rightclick
Endif
Cetin



>Cetin,
>
>Is there anyway to trap the click event in the column header? Clicking on the header or in the column returns 'COLUMN' as the base class. I just need to trap the header click.
>
>TIA
>
>John
>
>>
>>Yes Elyse,
>>It doesn't get the focus :(
>>You could have code in page rightclick like this :
>>
>>loObj = SYS(1270)
>>IF UPPER(loObj.BaseClass) = 'GRID'
>>	loObj.RightClick()
>>endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform