Re: GRID Click Event Fires Only Once
- From: "Dan Freeman" <spam@xxxxxxxxxxxxx>
- Date: Fri, 20 Jun 2008 08:44:07 -0700
When you close a grid's recordsource, it deconstructs. When you use it
again, it reconstructs using default controls so YOUR CODE IS GONE!
Your best bet is to take the code *out* of the grid and put it in a textbox
class of your own making. That way you can call column.addobject() each time
you use the grid and MAKE SURE your code is there.
Dan
Gerhard Gentele wrote:
Hello Dan,
thanks for the advice - but it doesn't work. Here the steps I make:
PART1:
I have ha GRID on a form set to visible=.f.
I open a table TESTTABLE
I bind the GRID to the table with GRID1.RECORDSOURCE= "TESTTABLE"
and make the GRID visible.
Now I have a little routine in GRID1 -> COLUMN2 -> TEXT1 -> CLICK
THIS CLICKEVENT ROUTINE NOW WORKS FINE
PART2:
next I tell the the GRID that the RECORDSOURCE is "" with
GRID1.RECORDSOURCE=""
now I close the table with CLOSE DATABASE
PART3:
I do the things described in PART1 again and the CLICKEVENT doesn't do
anything anymore and I have the question: WHAT WENT WRONG?
Greetings Gerhard
"Dan Freeman" <spam@xxxxxxxxxxxxx> schrieb im Newsbeitrag
news:%23taIHck0IHA.4040@xxxxxxxxxxxxxxxxxxxxxxx
The event still fires, but your code is gone because you've closed
the grid's data source. When you do that, the grid deconstructs.
Set the recordsource to "" before closing the table. Or, better yet,
don't close it. <g>
Dan
Gerhard Gentele wrote:
Hello Friends,
now I started using a GRID. It has two columns and uses as
RECORDSOURCE a DBF table. With a click i can change a .T. to .F. and
back again. Everything works fine until I close the table and make
the GRID unvisible. Starting everything again the same way brings
back the GRID, but the ability to fire an EVENT (such like a CLICK
or a RIGHTCLICK) is not possible anymore - it's gone...
CAN ANYBODY TELL ME WHY?
Greetings Gerhard
.
- References:
- GRID Click Event Fires Only Once
- From: Gerhard Gentele
- Re: GRID Click Event Fires Only Once
- From: Dan Freeman
- Re: GRID Click Event Fires Only Once
- From: Gerhard Gentele
- GRID Click Event Fires Only Once
- Prev by Date: Re: Reinstall XP
- Next by Date: Re: upnp help
- Previous by thread: Re: GRID Click Event Fires Only Once
- Next by thread: Re: Reinstall XP
- Index(es):
Relevant Pages
|