I have created the following public class colModelClass
so I can deserialize the colModel string for my jqgrid
public class colModelClass
{
public string name { get; set; }
public string index { get; set; }
public string jsonmap { get; set; }
public bool editable { get; set; }
public bool sortable { get; set; }
public int width { get; set; }
public string align { get; set; }
public bool hidden { get; set; }
public string sorttype { get; set; }
public string formatter { get; set; }
public string formatoptions { get; set; }
}
The problem is, formatoptions
isn't a string. It is a json
object with an unlimited number of possible items. Not only can it contain each standard formatoptions
item that ships with jqgrid
, but it can contain custom options as well.
Which Type
do I use for formatoptions
that will allow an object like this:
{ "srcformat": "m/d/Y", "newformat": "m/d/Y" }
or this
{ "decimalSeparator":".","thousandsSeparator":"," }
or any other number and combination of options (that won't require me to update my class if I add additional options)?
Or, how do I create a formatoptionsClass
class that will accept any string, bool, int, etc so it can build the class dynamically?