Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indirect reference to controls or binding to arraylist item
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Indirect reference to controls or binding to arraylist item
Versions des environnements
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01341965
Message ID:
01341965
Vues:
83
I have a Windows form on which I need to display a series of text boxes, each displaying the value of a field from a different row of the dataset. In FoxPro, one way I have done is by using a macro to get an indirect reference to the text box name.

For example:
* Using the indirect reference
lcBaseName = "TypeDesc"
lcRowCount = 1
use myTable
scan
    lcCurrentTextBox = lcBaseName + str(lnRowCount)
    &lcCurrentTextBox.Value = myTable.TypeDesc
endfor
In .NET, I tried creating a variable with a type of Control and building it's name property using a counter but I couldn't get that to work.

The other way I have done this in FoxPro is to set the ControlSource to an element of an array built from the table. In .NET, I tried creating an arraylist from the table and assigning an element to the BindingSource and the Text properties (not at the same time) with no success.

Does anyone have any suggestions? I really don't want to hard code this if I can avoid it.

Thanks in advance.
Linda Harmes
HiBit Technologies, Inc.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform