Session object as a datasource for Datagrid

A

Atif Jalal

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.
 
N

Naveen K Kohli

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"];
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top