Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to automatically Populate Lookup descr
Message
De
05/11/2011 20:35:00
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01528154
Message ID:
01528170
Vues:
40
I assume you mean for a Winform?
If so...
Typically, I use a strongly typed dataset datatable to hold the results of the lookup and bind the control's text to the relevant column in that datatable
For a new entry, there will be a blank row in that datatable and the description control's text will be blank.





>>Wondering whats the most Genric Way to populate a Lookup Description in C#.
Say I have a Customer Code, Stock Code, Inventory Item etc. Once I have 'taken' and 'Validated' these from a database table, nearly always I will want a TextBox with the Desdcription of the Item right beside it (e.g. Customer Name, Stock Description,Inventory name) etc.
I know I can insert some code in the validated Event of the Main Item , do a lookup, and then populate the description.
I am looking for a more generic , self contained way of doing this, in the Description Control itself.

Sometimes, I'l be adding a New Row, other times I will be viewing Existing Rows, so dont want to have separate code to cover these, if I can avoid it.
In VFP I would have had a contol like: (iif(seek(MyLookupField,'MYAlias','MyIndex'),MyTable.Description,' ')) and then just refresh the lookup field.

Is there a generic way of doing this in C#. Any ideas or examples would be appreciated
Tia
Gerard
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform