This is a migrated thread and some comments may be shown as answers.

Saving grid settings.

3 Answers 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 26 Jan 2012, 02:58 PM
Hi,

I tried to implement the demo located here:
http://www.telerik.com/help/aspnet/grid/grdsavingsettingsonperuserbasis.html 

The demo was written for the old set of controls; I tried to use the code against the latest version of RadGrid and get the following error:

Unable to cast object of type 'System.Collections.ArrayList' to type 'System.Object[]'.


getting thrown here, when trying to read the settings:

Dim gridSettings() As Object = CType(formatter.Deserialize(reader), Object())


I literally just copy/pasted the demo code into my app and changed the "Telerik.WebControls" reference to "Telerik.Web.UI" instead...

Note, I'm saving and reading the settings to a cookie.
Also tried saving to session (StateServer enabled) and get the same error.

Quick fix?

3 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 26 Jan 2012, 05:06 PM
Hello,

please set class as Serializable.

for more info : http://msdn.microsoft.com/en-us/library/ms973893.aspx

Thanks,
Jayesh Goyani
0
Sam
Top achievements
Rank 1
answered on 26 Jan 2012, 05:40 PM
Error still occurs with class marked serializable.
0
Andrey
Telerik team
answered on 31 Jan 2012, 08:44 AM
Hi,

You could check this help topic which content is upgraded to use the Ajax version of RadControls.

Greetings,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Sam
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Sam
Top achievements
Rank 1
Andrey
Telerik team
Share this question
or