Serializing a Datagrid

T

tshad

I am trying to save the pointer to my datagrids.

I have a pointer, oGrid, that is global and when when I bind to a Datagrid -
I am setting the oGrid to the that DataGrid. This is so I can clear that
DataGrid when I open another.

The problem is that when I postback, I lose the value in oGrid, so I need to
save that in ViewState (I believe). But when I do that I get:

The type 'System.Web.UI.WebControls.DataGrid' must be marked as Serializable
or have a TypeConverter other than ReferenceConverter to be put in
viewstate.

How do I set the DataGrid as Serializable and why do I need to? I 'm only
trying to save the pointer to the DataGrid which is already being saved in
the Viewstate.

Thanks,

Tom
 

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

Similar Threads


Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top