Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Datagrid Control (http://www.velocityreviews.com/forums/f60-asp-net-datagrid-control.html)
-   -   Binding data to Grid control with CUSTOM DATA CLASS (http://www.velocityreviews.com/forums/t763023-binding-data-to-grid-control-with-custom-data-class.html)

vineetbatta 10-16-2006 06:56 AM

Binding data to Grid control with CUSTOM DATA CLASS
 

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


All times are GMT. The time now is 04:27 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.