Binding data to Grid control with CUSTOM DATA CLASS

Discussion in 'ASP .Net Datagrid Control' started by vineetbatta, Oct 16, 2006.

  1. vineetbatta

    vineetbatta Guest

    I have Custom Data class which stores data about single customer and then i
    store that customer objects in arraylist as shown below.

    Customer custdata = null; // Custom Data class for 1 customer data.

    ArrayList ar = new ArrayList(); // To store more than one customer
    object.
    for (int x = 0; x < 30; x++)
    {
    custdata = new Customer();
    custdata.CustomerID = 1234 + x;
    custdata.CustomerName = "Name" + x.ToString();
    custdata.CustomerLocation = "UK " + x.ToString();
    custdata.CustomerType = x.ToString();

    ar.Add(custdata);

    }

    grid.; /// FEW Steps are missing and not sure to make it compatable to Grid.
    grid.DataBind();

    Now i want to bind data to gridView control, just like as we do if it was
    Datatable.
    Is there any simple conversion possible?

    I do not want to use DataSet or DataTable but collection of Customer Objects
    in Arraylist.

    Thanks in advance.


    -Vineet
    vineetbatta, Oct 16, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SmF5YnVmZmV0?=
    Replies:
    9
    Views:
    840
    Phillip Williams
    Feb 21, 2006
  2. Matt Sokol
    Replies:
    2
    Views:
    368
    Theo Tillotson
    Aug 7, 2003
  3. JcFx
    Replies:
    0
    Views:
    269
  4. David Alexander
    Replies:
    0
    Views:
    126
    David Alexander
    Jun 18, 2004
  5. dodo
    Replies:
    0
    Views:
    153
Loading...

Share This Page