bind list<> to DataGridView

D

Diego

I need to display a list of ojects (containing few fields like name,
surname, adress) in a Grid, is it possible to directly bind the list of
objects with the DataGridView?
Thanks,
Diego
 
G

Guest

Yes like this... IP.xml file is bind to this dataGridView1:

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
string filePath = "IP.xml";
ipDataset.ReadXml(filePath);
dataGridView1.DataSource = ipDataset;
dataGridView1.DataMember = "ip";
}

}

Hope it helps?
Jonte
 

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