How to bind an array list to datagrid?

W

Welman Jordan

I have an ArrayList, every item of which is an instance
of a class. If the class has this structure:

public interface ArrayListItemContent (
public string Name { get; set; }
public string Address { get; set; }
public string Phone { get; set; }
}

How can I databind an ArrayList of ArrayListItemContent
to a datagrid?? What asp.net code can I use? Can I use
the databind syntax like binding a dataset--
anArrayListInstance["Name"]?
 
G

Guest

Hi,

Just set DataGrid.Datasource to the instance name of the ArrayList and call
the DataBind() function.
 
G

Guest

Hi,

Just set Datagrid.datasource=<instance name of arraylist> and call the
DataBind() method.
 
W

Welman Jordan

Hello,

Thank you for replying.
I will try it later. I hope that can work.

W. Jordan

: Hi,
:
: Just set Datagrid.datasource=<instance name of arraylist> and call the
: DataBind() method.
:
: ---
: Bharat Biyani([email protected])
: http://www.orcim.com
:
: "Welman Jordan" wrote:
:
: > I have an ArrayList, every item of which is an instance
: > of a class. If the class has this structure:
: >
: > public interface ArrayListItemContent (
: > public string Name { get; set; }
: > public string Address { get; set; }
: > public string Phone { get; set; }
: > }
: >
: > How can I databind an ArrayList of ArrayListItemContent
: > to a datagrid?? What asp.net code can I use? Can I use
: > the databind syntax like binding a dataset--
: > anArrayListInstance["Name"]?
: >
: >
: >
: >
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top