I am using radgrid for asp.net version 4.5 (r.a.d.controlsQ4 2006).
The following code works when I run on visual studio but errors out when deployed to the IIS web servers -
Dim sortExp As GridSortExpressionCollection = RadGridCalendar.MasterTableView.SortExpressions()
If Not sortExp Is Nothing Then
Session.Add("CAL_SORT", sortExp)
'Else
Session.Add("CAL_SORT", "")
End If
I use the above session variable and apply the sort to another RadGrid.
The error I get is -
Exception type: SerializationException Exception message: Type 'Telerik.WebControls.GridSortExpressionCollection' in Assembly 'RadGrid.Net2, Version=4.5.0.0, Culture=neutral, PublicKeyToken=ec87bc2939ec45df' is not marked as serializable.
The stack trace is -
Stack trace: at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type)
at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer)
Custom event details:
Any help will be appreciated.
Thanks.