Hi Ken,
Thanks for the reply.
The array list contains "SelectedBook" objects which are instances of class
Book ... which are not simple data types.
eg:
public class Book
private strISBN as string
private strTitle as string
Private sngPrice as single
....
'Poperty procedures follow...
....
end class
Public class BookBasket
private arrSelectedBooks as arraylist = new arraylist
....
' property procedures etc follow ...
end class
I don't think a datagrid would be able to display the elements of the book
object without some special coding
Jared has pointed me to a good sample on gotdotnet which I am studying ... I
suspect it will do the job for me.
Thanks again for the reply.
Prime.
[quoted text, click to view] "Ken Cox [Microsoft MVP]" <BANSPAMken_cox@sympatico.ca> wrote in message
news:ezXbSJ2pEHA.1816@TK2MSFTNGP09.phx.gbl...
> You can bind a datagrid to a simple array list. Is that what you meant?
>
> Dim values As ArrayList = New ArrayList
> values.Add("IN")
> values.Add("KS")
> values.Add("MD")
> values.Add("MI")
> values.Add("OR")
> values.Add("TN")
> DataGrid1.DataSource = values
> DataGrid1.DataBind()
>
> "Prime" <not@real.address> wrote in message
> news:Od7SkPppEHA.2104@TK2MSFTNGP10.phx.gbl...
> > Hi All ...
> >
> > I'm writing a small shopping cart app (uni assignment) and need to list
> > all
> > the books that a user selects.
> >
> > I have created a "BookBasket" object that contains among other things an
> > arraylist of the user selected books.
> > The "book" object contains isbn,title price and quantity information.
> >
> > I'd like to display the contents of the BookBasket in a datagrid
control.
> >
> > I assume that to start with I'd have to iterate through the basket to
> > identify each books information, but then how do I populate the datagrid
> > manually?
> >
> > It seems from what I've read,that it is easier to populate a datagrid
from
> > a
> > datasource, but I don't know how that would relate to what I'm doing.
> >
> > any clues or links to examples would be much appreciated.
> >
> > Thanks in advance
> >
> > Prime.
> >
> >
> >
>