How can catch the dhtmlXgrid error?

The inner errors can be catched in next manner

function myErrorHandler(type, desc, erData){
    //custom code can be placed here
    return false;
dhtmlxError.catchError(“LoadXML”, myErrorHandler);

The array contains additonal data related to error
    erData=[xmlHttpRequest , object]

First element - xmlHttpRequest object, which contain all data requested
from server.
Second element - dhtmlx object, component which throw error while

You can get any additional error info by checking xmlHttpRequest
properties (xmlHttpRequest.responseText for example )


I am having 3000 records in my grid, when i am trying to import the grid as EXCEL file. It is not exporting and also its not throwing any error. So, I have placed the below code for error capturing, but its throwing any error. Please help me on to resolve this issue.

function gridConstructor() {
function my_error_handler(type, name, data) {
if (type == “ALL”);
alert(“My error handler \n” + name + “\n Status:” + data[0].status);
dhtmlxError.catchError(“ALL”, my_error_handler);

    mygrid = new dhtmlXGridObject('gridbox');

    //enabled column move 


Are you attempting to import or export data ?
Which code you are are using for that?

Above code snippet shows only grid initialization without any import|export commands.

I am exporting data from DHTML Grid. Please refer the below code.


$("#excel").click(function () {


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;

using DHTMLX.Export.Excel;
using DHTMLX.Export.PDF;
using System.IO;

namespace Grid2Pdf.Controllers
public class GeneratorController : Controller
[HttpPost, ValidateInput(false)]
public ActionResult GenerateExcel()
var generator = new ExcelWriter();
var xml = this.Request.Form[“grid_xml”];
xml = this.Server.UrlDecode(xml);
var stream = generator.Generate(xml);
return File(stream.ToArray(), generator.ContentType, “grid.xlsx”);

    [HttpPost, ValidateInput(false)]
    public ActionResult GeneratePDF()
        var generator = new PDFWriter();
        var xml = this.Server.UrlDecode(this.Request.Form["grid_xml"]);
        MemoryStream pdf = generator.Generate(xml);
        return File(pdf.ToArray(), generator.ContentType, "grid.pdf");


please try the latest version of the export tool, …
does the issue occurs in this version? If so, please provide the xml data that recieved on this line, so we could inspect it xml = this.Server.UrlDecode(xml);

Yes. I am able to export the 3000 rows. :laughing:

Is there any possible to export the selected rows, suppose if i want to export 10, 100 or 200 rows?.

I am using checkbox to select the rows for exporting into Excel.


Is there any possible to export the selected rows from DHTML Grid?

Only selected or to highlight selected rows in generated PDF/Excel?

We want to Export only the selected rows to excel. The selection will be done using the checkbox in the grid. We tried the below option but it did not work.


you should try the follow:


The last parameter is and array of rows id. If parameter ignored then all rows are exported, otherwise only rows from this list must be exported.