Windows

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • binding arraylist of structures to grid

    0 answers - 1244 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Are you doing a dataGrid1.DataBind() to bind the data to the contol so it
    will actually have something to render?
    Message
    From: belzicool [mailto:belzicool (AT) yahoo (DOT) com]
    Sent: 22 July 2005 09:28
    To: CSharpNET (AT) yahoogroups (DOT) com
    Subject: [C#.NET] binding arraylist 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
    SURCE 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.

Re: binding arraylist of structures to grid


max 4000 letters.
Your nickname that display:
In order to stop the spam: 2 + 1 =
QUESTION ON "Windows"

EMSDN.COM