473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DataGrid binding to an arraylist of items object

Hi,

I'm wondering if there is a way to bind to datagrid or a gridview the
items in an arraylist. These items all have vars such as price,
qty..etc? (besides putting in a datagrid or datatable first).

ex.
ArrayList alShoppingCart = shoppingCart.GetCurrentItems;
alShoppingCart contains an array list of Item objects.

Thanks
Maz.

May 12 '06 #1
2 2181
it is possible
just play with it and you will find out what you need

post again if have some specific questions or troubles

Galin Iliev[MCSD.NET]
www.galcho.com

May 12 '06 #2
ma*******@gmail.com wrote:
Hi,

I'm wondering if there is a way to bind to datagrid or a gridview the
items in an arraylist. These items all have vars such as price,
qty..etc? (besides putting in a datagrid or datatable first).

ex.
ArrayList alShoppingCart = shoppingCart.GetCurrentItems;
alShoppingCart contains an array list of Item objects.

Thanks
Maz.

You can bind a datagrid of gridview to any collection. You then set the
DataSource attribute of the datacrdi or gridview to the arraylist.
Look at this very good example:
http://webthingsconsidered.blogspot....idview-or.html
May 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Stephen | last post by:
I've got a datagrid with a remove button and I would like to add some code in the code behind page so as whenthe button is clicked the corresponding row in the datagrid is removed. The Datagrid is...
4
by: Stephen | last post by:
I have got an event below to remove items from an arraylist and then to rebind the arraylist to the datagrid subsequently deleting the appropriate row. My problem is that my code makes sense and I...
3
by: Douglas Gage | last post by:
I have two columns Question Answers Q1 Q2 Q3 Q4 Submit
4
by: Christiaan | last post by:
Hi, I have two classes, Department and Employer, the Department contains an ArrayList (employers) filled with Employer objects. I want to display an ArrayList filled with Department objects using...
0
by: Wiktor Zychla | last post by:
Hello, I am thinking of a general solution to the specific issue and I hope someone has some more experience on that. Up to now I use the ListView as the primary control for collections of...
0
by: Stephen | last post by:
I have a datagrid with a remove button and I would like to add some code in the code behind page so as whenthe button is clicked the corresponding row in the datagrid is removed. The Datagrid is...
3
by: Rami | last post by:
Hey, I Tried to bind a DataGrid to an ArrayList, and had 2 problems: 1. The DataGrid shows the Length property of the items instead of their text - how can I change that? 2. After binding, I add...
4
by: Alan Silver | last post by:
Hello, I'm trying to use an ArrayList to do data binding, but am getting an error I don't understand. I posted this in another thread, but that was all confused with various other problems,...
5
by: Rami | last post by:
Hey, I Tried to bind a DataGrid to an ArrayList, and had 2 problems: 1. The DataGrid shows the Length property of the items instead of their text - how can I change that? 2. After binding, I add...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.