GridView ObjectDataSource

G

Guest

Is it possible to do the following:-

Create an ObjectDataSource object that has an embedded ArrayList of Objects.
Allow the ASP.NET application to create and populate an instance of the
ObjectDataSource...and pass this to a GridView control... I don't want the
GridView control to create its own instance of the ObjectDataSource object.??
this could be where the problem is...

For example I have

a class called ItemLine with properties int _ItemLn, DateTime _ItemDate,
string _Desc, double _Amount...with the usual get/setters
....int ItemLn() { get{ return _ItemLn;} set{ _ItemLn=value;} etc

I then populate an array with ItemLine objects for example

1,12/12/2006,"hello1",3.99
2,13/11/2006,"helo2",2.99
etc


This ArryaLIst of ItemLine is then enclosed in a ItemLineDataSource class
with methods for returning all the items, updating, inserting and deleting
items...

This ItemLineDataSource instance should then be used with the GridView
control!!!

is this possible?
 
G

Guest

Okay I now realise that the ObjectDataSource used with a GridView must be
stateless, have a default zero parameter constructor etc.... so it can't work
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top