Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid - Refresh
Message
De
23/03/1999 06:26:12
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
22/03/1999 21:36:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00200768
Message ID:
00200830
Vues:
12
>Why the grid does no change? How can I show the correct data after the click the command button?
>Thank you!
>
>define class clsform as form
> top=5
> left=5
> width=300
> height=300
>
> add object mycmd as CommandButton with;
> left=5, top=80, height=15, width=100,;
> caption="change"
>
> add object mygrid as grid with;
> left=5, top=100, height=200, width=150,;
> recordsourcetype=4,;
> recordsource="select nane from company "+;
> "where left(cty_origin,1) <> 'H' into cursor mycur"
>
> procedure mycmd.click
> recordsource="select nanme from company "+;
> "where left(name,1) = 'U' into cursor mycur"
> thisform.mygrid.refresh
> thisform.mygrid.setfocus
> endproc
>enddefine
Oliver,
Instead of changing recordsource just change parameter :
define class clsform as form
 top=5
 left=5
 width=300
 height=300
 myFilter = "H"
*.....
add object mygrid as grid with ;
  left=5, top=80, height=15, width=100,;
  caption="change" ;
  recordsourcetype=4,;
  recordsource="select nane from company "+;
          "where left(cty_origin,1) <> "+;
           trim(this.myFilter)+;
          " into cursor mycur"
*....
procedure mycmd.click
      thisform.myFilter = 'U'
      thisform.mygrid.refresh
      thisform.mygrid.setfocus
endproc
And be sure to keep an index tag on your expression (left(cty_origin,1)). Also left(cty_origin,1) = "H" and cty_origin = "H" would mean same unless you set exact, ansi on. IMHO it's better to have a tag with key expression cty_origin and use cty_origin = "H" in where clause.
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