Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid refreshing
Message
De
07/08/2001 11:37:26
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00540286
Message ID:
00540739
Vues:
20
>>>>>how do you refresh a grid? I have one with the following
>>>>>WITH THISFORM.grid1
>>>>> ROWSOURCE= "Select price,quantity,noun from trans"
>>>>> ENDW
>>>>>and a click of a cmd button does the following :
>>>>>SELE TRANS
>>>>>GO TOP
>>>>>DELE next 1
>>>>>PACK
>>>>>the grid goes empty after clicking. I've tried refreshing the form too.
>>>>
>>>>Tim,
>>>>I think there are some typos in code. You CAN pack your table but as a general guideline don't do it. ie:
>>>>
>>>>
*Grid1.init
>>>>with this
>>>>  .RecordSourceType = 4
>>>>  .RecordSource = 'select * from customer into cursor crsGrid'
>>>>endwith
>>>>
>>>>*Commabutton.click
>>>>with ThisForm.Grid1
>>>>  select customer
>>>>  locate for cust_id = trim(.Columns(1).Text1.Value)
>>>>  delete next 1
>>>>  pack
>>>>  .recordsource = .recordsource
>>>>  .Columns(1).Setfocus()
>>>>endwith
Cetin
>>>
>>>Cetin, I've the deletion part ok(I guess) but the thing is when you have say 5 items in the grid and you want the user to click on the one he wants deleted, say the 3 item in the grid. The user puts the mouse over the 3rd item but it does respond even though I have a proceedure in the grid's click event. Howver, if you click on an empty part of the grid, the click event fires.
>>
>>Tim,
>>You mean it doesn't get focus or grid.click doesn't run ? If latter that's default behaviour of grid. You can use something like Nick's click transparent control to intercept clicks over grid.
>
>Cetin, GRID.CLICK FIRES ONLY WHEN YOU DON'T CLICK ON an item but fires if you click on some emptyness(white blank) part on the grid.

Tim,
Why are you shouting ? Did I say something different ?
Default behaviour of grid - Mouse events occur for :
Grid - If on an empty space
Column - If not on active row (Except *click which occurs for cell)
Control - If on active cell (Might be header too)

If you place a transparent container in front of grid you can intercept mouse events and propagate to grid if you want.
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform