Data Binding to array/list

K

KCT

I am creating a report screen then look like this :

ItemName Quantity
A 1
B 2
C 3
--End of Page--

The data is not store in the database. Supposely that my application gets
the data from a list or array, how do I do a data binding to the above
fields ?
 
S

Sijin Joseph

You can set the DataSource of the control to the ArrayList or whatever
collection class you are using.
 
S

Sijin Joseph

Then you can use

//Where myArray holds a collection of item names and 'i' is the index of the
item
textLabel.DataBindings.Add("Text",myArray,"ItemName");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top