Session object as a datasource for Datagrid

Discussion in 'ASP .Net Datagrid Control' started by Atif Jalal, Aug 13, 2003.

  1. Atif Jalal

    Atif Jalal Guest

    Is it possible to have a session object as a datasource for datagrid
    control. AS I will be adding rows dynamically. So if I store it in
    session on the fly and update the datagrid, will that work? The
    session will store an object with many data members, which can be the
    columns for datagrid. I don't want to store in database as, untill the
    user hit the save button, the new row to be added to the datagrid is
    not supposed to be added to database. As user may delete the new row
    added to datagrid, before saving the data to database.

    Help appreciated.
    Atif Jalal, Aug 13, 2003
    #1
    1. Advertising

  2. Yep.. it works like a champ. Only thing will be that on post backs you will
    have to do the right type casting.

    myGrid.DataSource = (DataSet)Session["hereismydata"];

    --
    Naveen K Kohli
    http://www.netomatix.com
    "Atif Jalal" <> wrote in message
    news:...
    > Is it possible to have a session object as a datasource for datagrid
    > control. AS I will be adding rows dynamically. So if I store it in
    > session on the fly and update the datagrid, will that work? The
    > session will store an object with many data members, which can be the
    > columns for datagrid. I don't want to store in database as, untill the
    > user hit the save button, the new row to be added to the datagrid is
    > not supposed to be added to database. As user may delete the new row
    > added to datagrid, before saving the data to database.
    >
    > Help appreciated.
    Naveen K Kohli, Aug 13, 2003
    #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. Jeff Smythe
    Replies:
    3
    Views:
    1,238
    Jeff Smythe
    Jan 2, 2004
  2. matthew schouppe
    Replies:
    3
    Views:
    2,354
    Scott Allen
    Apr 30, 2004
  3. momo898
    Replies:
    2
    Views:
    491
    bruce barker \(sqlwork.com\)
    Oct 12, 2006
  4. matthew schouppe

    DataGrid ItemStyle is a textbox and doesn't update the datagrid datasource

    matthew schouppe, Apr 29, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    199
    Scott Allen
    Apr 30, 2004
  5. Jason
    Replies:
    0
    Views:
    207
    Jason
    Oct 24, 2006
Loading...

Share This Page