Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What do you think of this picklist idea?
Message
De
13/07/1998 14:44:12
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00116853
Message ID:
00116900
Vues:
18
>>>You can set the rowsourcetype to None and put this code in the requery of the combo;
>>>
>>>
>>>* Combo classes requery
>>>LOCAL lcAlias, lcOrder, lnNewItem
>>>lcAlias = ALIAS()
>>>SELECT <TheAlias for the combo>
>>>lcOrder = SET("ORDER")
>>>SET ORDER TO <the tag you want>
>>>GO TOP
>>>WITH THIS
>>>   .Clear()
>>>   lnNewItem = .NewItemId + 1
>>>   .AddListItem("<NEW>",lnNewItem)
>>>   SCAN
>>>      lnNewItem = .NewItemId + 1
>>>      .AddListItem(TabelFieldName,lnNewItem)
>>>   ENDSCAN
>>>ENDWITH
>>>
>>>
>>>The add a call to the Requery in the Init to the combo is initially filled. Anytime you want to refresh the list of options in the combo call its requery method.
>>
>>I haven't tried this because my help file says that .AddListItem and .AddItem only work when .RowSourceType=0. I don't want to build the list, I want to use .RowSourceType=3 or 6.
>
>Bill,
>
>Every time I have encountered any problem doing what I want with a list or combo, I have use rowsourcetype 0 and done the above code. I have not encountered any performance problems with this approach and I have gained complete control over the list contents. I goen to using this appraoch as my default approach now and only revert to other rowsourcetypes when there is an overriding reason to dos so.

That's interesting. I just assumed that building the list would take too long. What kind of time does it take when your list is about 10,000 names?

I was using a view for the .RowSource and appending a record onto the view, then indexing it (to get '< new >' to the top. I didn't like the time involved in indexing when the file got large. Which is why I'm hoping to just use the base table as the .RowSource.
Bill Morris
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform