private string GetColModel(JQGrid grid) { Hashtable[] array = new Hashtable[grid.Columns.Count]; for (int i = 0; i < grid.Columns.Count; i++) { JsonColModel jsonColModel = new JsonColModel(grid.Columns[i], grid); array[i] = jsonColModel.JsonValues; } string input = new JavaScriptSerializer().Serialize(array); return(JsonColModel.RemoveQuotesForJavaScriptMethods(input, grid)); }
private string GetColModel(JQGrid grid) { List <string> lTreeGridColumn = new List <string>(); lTreeGridColumn.Add("level"); lTreeGridColumn.Add("parent_id"); lTreeGridColumn.Add("isLeaf"); lTreeGridColumn.Add("expanded"); grid.Columns.RemoveAll(g => lTreeGridColumn.Contains(g.DataField)); Hashtable[] hashtableArray = new Hashtable[grid.Columns.Count]; for (int i = 0; i < grid.Columns.Count; i++) { //if (lTreeGridColumn.Contains(grid.Columns[i].DataField)) continue; JsonColModel model = new JsonColModel(grid.Columns[i], grid); hashtableArray[i] = model.JsonValues; } return(JsonColModel.RemoveQuotesForJavaScriptMethods(new JavaScriptSerializer().Serialize(hashtableArray), grid)); }