Grid 
Author Message
 Grid

I'm trying to figure out how to accomplish the following:

I have a form that I've added a grid control to it, which
get populated at run using the following code.

IF OpenFile( cFile, cAlias, nArea )
   DO FORM "C:\SOURCE\VBPF\Forms\xform"

   xForm.grid.recordSource = cAlias
   xForm.Caption = cFile
   xForm.Tag = cAlias
ENDIF

What I want to do is bring up a pop up menu whenever the
user right clicks on a column header.

I know that the column header has a rightclick event but
since at desgin time my grid has no columns I don't know
how to added the code.

Thanks



Sat, 03 Sep 2005 01:22:40 GMT  
 Grid
Unless you're using VFP8, you can't do it very easily.  You'll have to
predefine a grid with the columns you want to see, so that you can put code
in them.  Either that, or you'll have to dynamically add a custom header
class to your grid after you've removed the standard one.

If you're using VFP8, you can do this easily with BINDEVENT() at runtime.

--

Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.

Quote:

> I'm trying to figure out how to accomplish the following:

> I have a form that I've added a grid control to it, which
> get populated at run using the following code.

> IF OpenFile( cFile, cAlias, nArea )
>    DO FORM "C:\SOURCE\VBPF\Forms\xform"

>    xForm.grid.recordSource = cAlias
>    xForm.Caption = cFile
>    xForm.Tag = cAlias
> ENDIF

> What I want to do is bring up a pop up menu whenever the
> user right clicks on a column header.

> I know that the column header has a rightclick event but
> since at desgin time my grid has no columns I don't know
> how to added the code.

> Thanks

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.462 / Virus Database: 261 - Release Date: 3/13/2003


Sat, 03 Sep 2005 09:59:35 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Grid....grid....grid...

2. GRID GRID GRID

3. Grids Grids Grids

4. Adding Menu to grid and toolbars to grids

5. refresh the grid pointer outside the grid

6. how to gracefully remove a grid column (in middle of grid)

7. Delete a grid from a column of grid

8. refresh grid pointer outside the grid

9. GRID: How to prevent moving in grid?

10. VFP6 Printing a grid (not grid control)

11. Setting grid recordset property programatically alters my grid layout

12. Grid Control, setting order of items in grid after population

 

 
Powered by phpBB® Forum Software