displaying data from arrraylist of structures to grid
Hi,
I am writing a small application in C#. I have a structure called public struct QXF_data
{
public string source;
public string target;
}
I want to create an arraylist of these structures and bind it to a data grid in C#.
ArrayList QXFlist = new ArrayList();
QXF_data qdata1 = new QXF_data();
qdata1.source="a";
qdata1.target="b";
QXF_data qdata2 = new QXF_data();
qdata1.source="c";
qdata1.target="d";
QXFlist.Add(qdata1);
QXFlist.Add(qdata2);
I am doing this by simply setting the data source of the grid to the arraylist.
dataGrid1.DataSource = QXFlist;
But the result is not what i expect. (actually the grid is blank)
I want the result as
SOURCE TARGET
1. a b
2. c d
I am new with C# and need some help with this.
Can anyone please help me with this?
Thanx a lot in advance.
--
Nikhil