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
on a particular users set of data ie in an arraylist...
"pblack9455" wrote:
> 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?
>
>
|