+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Custom module: sort by custom field

Custom module: sort by custom field

5 posts, 0 answered
  1. jocelyn payneau
    jocelyn payneau avatar
    51 posts
    Registered:
    07 Dec 2009
    29 Jan 2011
    Link to this post
    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
           {
               get
               {
                   return this.lastName;
               }
               set
               {
                   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?

    Thanks

    Jocelyn
  2. Teodor
    Teodor avatar
    52 posts
    Registered:
    24 Sep 2012
    01 Feb 2011
    Link to this post
    Hello jocelyn,

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

    Best wishes,
    Teodor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Suranga
    Suranga avatar
    12 posts
    Registered:
    22 Mar 2010
    07 Aug 2011
    Link to this post
    I'm having same exact issue. Do you have any advice please?
  4. Milena
    Milena avatar
    75 posts
    Registered:
    15 Jul 2016
    10 Aug 2011
    Link to this post
    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,

    Milena
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  5. Suranga
    Suranga avatar
    12 posts
    Registered:
    22 Mar 2010
    13 Aug 2011
    Link to this post
    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.
5 posts, 0 answered