Hi Kovács,
Thanks for using Syncfusion Products.
We have analyzed your code snippets and found that you are hiding column at initial load which is the cause of the issue since the “hideColumns” Grid method is called before complete rendering of Grid. So we suggest you to use “visible” property of Grid Columns to hide the columns at initial rendering of Grid. Please refer the following code snippets.
$("#Grid").ejGrid({ columns: [ { field: "OrderID", isPrimaryKey: true, headerText: "OrderID",visible:false, textAlign: ej.TextAlign.Right, width: 80 }, ... }) |
For your convenience we have created a sample and the same can be downloaded from below link.
Sample: http://www.syncfusion.com/downloads/support/directtrac/130733/EJGrid1865652427.zip
If you need to use “hideColumns” method at initial load then we suggest you to call it in “actionComplete” Grid event. Please refer the following code snippets.
$("#Grid").ejGrid({ ... actionComplete: "complete" }); function complete(args) { if (hide == false && args.requestType == "refresh") {// We have used hide variable to check this is an initial load hide = true; var gridObj = $("#Grid").data("ejGrid"); gridObj.hideColumns("OrderID"); } } |
Please let us know if you need any further assistance.
Regards,
Alan Sangeeth S