Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView ObjectDataSource

Reply
Thread Tools

GridView ObjectDataSource

 
 
=?Utf-8?B?cGJsYWNrOTQ1NQ==?=
Guest
Posts: n/a
 
      11-26-2006
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?


 
Reply With Quote
 
 
 
 
=?Utf-8?B?cGJsYWNrOTQ1NQ==?=
Guest
Posts: n/a
 
      11-28-2006
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?
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM
ObjectDataSource method as another ObjectDataSource David Thielen ASP .Net Web Controls 3 03-23-2006 01:50 AM
gridview, objectdatasource family ASP .Net 0 12-22-2005 03:28 PM
GridView update with ObjectDataSource Danny W ASP .Net 0 09-08-2005 06:30 AM
xpo objectdatasource gridview detailview Kha Tran ASP .Net 0 06-03-2005 09:22 AM



Advertisments