GridView ObjectDataSource

Discussion in 'ASP .Net' started by =?Utf-8?B?cGJsYWNrOTQ1NQ==?=, Nov 26, 2006.

  1. 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==?=, Nov 26, 2006
    #1
    1. Advertising

  2. 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?
    >
    >
    =?Utf-8?B?cGJsYWNrOTQ1NQ==?=, Nov 28, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kha Tran
    Replies:
    0
    Views:
    549
    Kha Tran
    Jun 3, 2005
  2. Danny W

    GridView update with ObjectDataSource

    Danny W, Sep 8, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    3,068
    Danny W
    Sep 8, 2005
  3. family

    gridview, objectdatasource

    family, Dec 22, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    529
    family
    Dec 22, 2005
  4. =?Utf-8?B?Sm9obl9I?=
    Replies:
    1
    Views:
    2,767
    =?Utf-8?B?Sm9obl9I?=
    Jan 19, 2006
  5. David Thielen

    ObjectDataSource method as another ObjectDataSource

    David Thielen, Mar 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    241
    Steven Cheng[MSFT]
    Mar 23, 2006
Loading...

Share This Page