Custom module: sort by custom field - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Custom module: sort by custom field

  • Custom module: sort by custom field
  • Hello,

    I develop a custom module to manage a list of agents. An agent is defined by a lastname, a firstname, an address...

    Here is the declaration of the "lastname" field in my model.
    [CommonProperty, DataMember, Sortable, UserFriendlyDataType(UserFriendlyDataType.ShortText)]
           public string LastName
                   return this.lastName;
                   this.lastName = value;

    Here is the definition of my gridview:
    var contactsGridView = new MasterGridViewElement(backendContentView.ViewsConfig)
                   ViewName = ContactsDefinitions.BackendListViewName,
                   ViewType = typeof(MasterGridView),
                   AllowPaging = true,
                   DisplayMode = FieldDisplayMode.Read,
                   ItemsPerPage = 50,
                   ResourceClassId = typeof(ContactsResources).Name,
                   SearchFields = "LastName, FirstName",
                   SortExpression = "LastName ASC",
                   Title = "ContactsViewTitle",
                   WebServiceBaseUrl = "~/Sitefinity/Services/Content/Contacts.svc/"

    When i go to my page to create a new contact I have a loop javascript alert with this message:
    Could not deserialize service response, because it was empty or not a valid JSON.

    Do you have any idea of what causes this error?


  • Hello jocelyn,

    Please can you send a sample project with DB to check the problem locally.

    Best wishes,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  • I'm having same exact issue. Do you have any advice please?
  • Hi Su,

    It is clear that problem is with deserialization of web service response, but  we need more information about the data that cause this issue at custom implementation.

    Can you send us your configuration and database that can give us a clue what is the problem ?

    Thanks in advance!

    Kind regards,

    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
  • Thank you for your reply. I managed to find the issue. I forgot to add entries to the Resources file for my new fields. After that it did work.

    Thanks again.