I mean, you can keep it wherever you want...viewstate, session,
cache..whatever appropriate for your situation (don't know enough to tell
you).
The framework doesn't keep the dataset in the viewstate. It keeps the
controls which make up the datagrid (which were build using the dataset) but
not the dataset itself...
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"vips" <yp**@hotmail.com> wrote in message
news:OG**************@TK2MSFTNGP09.phx.gbl...
u mean I need to keep the dataset it in viewstate ??
but the framework itself keeps it in viewstate ...cant i access it some
how
??
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:u1****************@TK2MSFTNGP14.phx.gbl... That's right. The datasource isn't maintained in viewstate as a raw
dataset..instead only the information necessary to the datagrid (rows,
columns, ...) are maintained. If you need the dataset again you'll
need
to either recreate it or store it somewhere...
KArl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"vips" <yp**@hotmail.com> wrote in message
news:OZ**************@TK2MSFTNGP14.phx.gbl... > Page_Load
>
> datagrid1.datasource=dataset1
>
> //I am filling the datagrid and it works fine when page is displayed
>
> end
>
> ---------------
>
> button 1_click
>
> dim ds as dataset
>
> ds=datagrid1.datasource
>
> //gives error
>
> end
>
>
>
> when I try to get the datasource from a datagrid (i.e. a dataset) it gives > error
>
> "Object reference not set to an instance of an object."
>
> is it due to postback event the datagrid's datasource is not accessible ?? >
>
>
> vips
>
>
>
>