Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Moran 285 posts 934 karma points
    Sep 09, 2014 @ 07:27
    Moran
    0

    using the grid with a controller

    Hi is there an option to write values into the grid, like in the uComponents grid? Thanks

  • Luke 110 posts 256 karma points
    Oct 22, 2014 @ 19:06
    Luke
    0

    Hi, looking for the same functionality - did you work this one out?

    Regards, L

  • Luke 110 posts 256 karma points
    Oct 22, 2014 @ 21:58
    Luke
    0

    Hi,

    I figured this one out - The data is simply saved as JSON. As such you can simply write JSON as the value. My solution was:

    1. Create a class to model the properties (ensuring my attribute names matched the alias of the Content Grid property)

      public class Foo { public string AliasName { get; set; } public string AliasName2 { get; set; } }

    2. Created a JSON helper method to serialize the data

      public static string ToJson(this object obj)
      {
          JavaScriptSerializer serializer = new JavaScriptSerializer();
          return serializer.Serialize(obj);
      }
      
    3. Set the value for your content

      content.setValue("name", ToJson(new List

    Hope that helps!

    Regards, L

  • Moran 285 posts 934 karma points
    Oct 24, 2014 @ 11:29
    Moran
    0

    Hi thanks :) I will try it.

Please Sign in or register to post replies

Write your reply to:

Draft