How to populate data in combobox or select box in datagrid using JSON. please help i cannot find any tutorial, i tried experimenting but to no avail. any help would be appreciated thanks again
can use dhtmlxConnector.http://www.dhtmlx.com/docs/products/dhtmlxConnector/index.shtml
C# *.ashx example
namespace dhtmlxConnector.Net_Samples.dhtmlxGrid
{
/// <summary>
/// Connector body
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class explicitOptionsConnector : dhtmlxRequestHandler
{
public override IdhtmlxConnector CreateConnector(HttpContext context)
{
dhtmlxGridConnector connector = new dhtmlxGridConnector(
"BookStore",
"sales, title, author, price, instore, shipping, bestseller, pub_date",
"book_id",
dhtmlxDatabaseAdapterType.SqlServer2005,
ConfigurationManager.ConnectionStrings["SamplesDatabase"].ConnectionString
);
connector.ExplicitOptions.Add((TableField)"shipping", "na", "1 Day", "3 Days", "5 Days");
connector.Request.TransactionMode = TransactionMode.PerRecord;
return connector;
}
}
}
Thanks for the effort to help me, acctually i am generating datagrid textbox, checkbox values using json object by parsing , json structure looks like this:
var jsonko = {data:[
{rows:[
{ id:“DataGrid001-0”,data:[“1”,“two”] },
{ id:“DataGrid001-1”,data:[“1”,“two”] },
{ id:“DataGrid001-2”,data:[“1”,“two”] }
]
}
]
}
mygrid.parse(jsonko,“json”);
this works for textbox and checkbox
it i just dont know what to feed combobox or select box using json object, i tried feeding it with json array like :
var jsonko = {data:[
{rows:[
{ id:“DataGrid001-0”,data:[{“a”,“b”,“c”}]},
{ id:“DataGrid001-1”,data:[{“a”,“b”,“c”}]},
{ id:“DataGrid001-2”,data:[{“a”,“b”,“c”}]} ]
}
]
}
mygrid.parse(jsonko,“json”);
and it cause me error, json structure is correct but dhtmlxgrid does not read it.
Has anybody been able to successfully do this?
We changed the format of our grid from XML to JSON but we have a cell type “coro” (Selection box). This is not working in JSON. We do not know what is the right format to represent this in JSON. All example we have seen so far talks about XML only.
We are currently stuck as we are not able to resolve this.