dhxGrid + .NET Connector + json

Hi,
we are trying the evaluating version of dhx Grid.
We need to use it in a .NET environment using your .NET Connector to return data in a JSON format.

We try with this settings:

.NET PAGE:
In our VIEW we have all the references needed by the grid…

[code]<link rel=“STYLESHEET” type=“text/css” href="@Url.Content("~/plugins/dhtmlxGrid/dhtmlxGrid/codebase/dhtmlxgrid.css")" />

[/code]

…and the grid initialization:

[code]

[/code]

GridConnector.ashx is our Request Handler.
We expect it returns a valid json for Grid. It’s not true, we receive a javascript error on filling!!

[WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class GridConnector : dhtmlxRequestHandler { public override IdhtmlxConnector CreateConnector(HttpContext context) { return new dhtmlxDataJsonConnector( "EXECUTE MY_STOREDPROCEDURE_WITHOUT_PARAMS", String.Empty, dhtmlxDatabaseAdapterType.SqlServer2005, ConfigurationManager.ConnectionStrings["MY_CONNECTION_STRING"].ConnectionString ); } }

Using xml as output format, we have no problem to fill the grid:

mygrid.load("@Url.Content("~/RequestHandlers/GridConnector.ashx")");

The class used for this format is dhtmlxGridConnector class instead of dhtmlxDataJsonConnector.

Where is our error?

Hello,
unfortunately there is no json connector for dhtmlxGrid. Xml connector is the only option.
dhtmlxDataJsonConnector and dhtmlxDataConnector are designed for dhtmlxTouch and grid can’t work with them.
Technically grid can load data from dhtmlxDataJsonConnector if you initialize it like following

var mygrid = new dhtmlXGridObject('gridbox'); ... mygrid.setColumnIds("field1,field2,..."); mygrid.load("baseGridConnector.ashx", "js") ;
But it will work only for simple data loading - insert/update/delete operations won’t work, as well as server-side sorting, filtering and dynamic loading.

Hi,

I’m too evaluating grid control and my requirement is to check if this possible to integrate with ASP.NET. I tried to find on forum but could not find a working sample where I can get a overview of insert/update/delete operation on the grid. Is it possible to provide a sample example in ASP.NET with these operations on grid? This will help in taking a quick decision for using this control.

Thanks in advance!

Sandy.

You can grab connector package, which contains .net based samples for all major components, including grid

dhtmlx.com/x/download/regula … or_net.zip

Also there is separate sample for .NET MVC

dhtmlx.com/blog/?p=1349

Thanks a lot for the code samples!