Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   GridView ObjectDataSource (http://www.velocityreviews.com/forums/t383022-gridview-objectdatasource.html)

=?Utf-8?B?cGJsYWNrOTQ1NQ==?= 11-26-2006 11:02 PM

GridView ObjectDataSource
 
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?



=?Utf-8?B?cGJsYWNrOTQ1NQ==?= 11-28-2006 09:12 AM

RE: GridView ObjectDataSource
 
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?
>
>



All times are GMT. The time now is 02:33 PM.

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