0

I want to sort grouped columns of syncfusion Grid in my way, for that i have created a derived class by extending GridSortColumnDescriptor

[DataContract()]
    [XmlInclude(typeof(ReviewerGridGroupingColumnSort)),XmlInclude(typeof(SynfusionCustomGridSorting))]
    public class SynfusionCustomGridSorting : GridSortColumnDescriptor
    {
        private  ReviewerGridGroupingColumnSort _sortGroupColumn= new ReviewerGridGroupingColumnSort ();
        public SynfusionCustomGridSorting()
        {
            this.ShouldSerialize();
            _sortGroupColumn.SortColumnName =this.Name;
            this.Comparer = _sortGroupColumn;

        }


    }

ReviewerGridGroupingColumnSort is my custom sorting class.

Every thing is working fine but at the end i am getting this exception.

System.InvalidOperationException: The type MarketWorkFlowWebApp.Common.SynfusionCustomGridSorting was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically. at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterGridEngine.Write13_SortColumnDescriptor(String n, String ns, SortColumnDescriptor o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterGridEngine.Write45_GridTableDescriptor(String n, String ns, GridTableDescriptor o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterGridEngine.Write48_GridEngine(String n, String ns, GridEngine o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterGridEngine.Write49_GridEngine(Object o)

What am I doing wrong here?

SSteve
  • 10,550
  • 5
  • 46
  • 72
Pavan Tiwari
  • 3,077
  • 3
  • 31
  • 71

1 Answers1

0

Custom sorting can be performed using GridGroupingControl.TableDescriptor.SortedColumns.Changing event. By using this event you can use the custom comparer and perform custom sorting. Please refer the below online documentation link for more details regarding custom sorting.

Documentation Link: http://help.syncfusion.com/ug/asp.net/default.htm#!documents/customsorting.htm

Please let us know if you have any other questions or concerns.