Hi,
I have implemented remote paging as shown in documentation.
Below is the complete markup for grid:
<style type="text/css"> #testGrid { table-layout: auto!important; }
#testGrid_scroll { overflow-x: auto!important; }
#testGrid>tbody>tr>td { white-space: nowrap; } </style>
@(Html.Infragistics().Grid<testData>(Model).ID("testGrid")
.AutoGenerateColumns(true) .FixedHeaders(false)
.Features(features => { features.Paging().PageSize(50).Type(OpType.Remote); features.Selection().Mode(SelectionMode.Row).MultipleSelection(false).Activation(true); features.Filtering().Mode(FilterMode.Advanced).CaseSensitive(false); features.Sorting(); features.Resizing(); })
.DataSourceUrl(Url.Action("GetTestGridData"))
.Height("655px") .DataBind() .Render() )
But I am getting javascript error:
Unhandled exception at line 25, column 75466 in http://localhost:23387/Scripts/Ig/modules/infragistics.ui.grid.framework.js
0x800a139e - Microsoft JScript runtime error: You have autoGenerateColumns set to false, but there are no columns defined in the grid. Please set autoGenerateColumns to true, or specify columns manually
Any help would be appreciated.
Hi Martin,
The problem is something else, since I am getting data and grid is also working for LOCAL PAGING.
Its throwing that error only when I change it to REMOTE Paging.
Below is the code controller code:
[GridDataSourceAction]public ActionResult GetMeasurementGridData(){ Measure measureData = AppCacheManager.GetCacheData<Measure>("Measurements"); return View(measureData.AsQueryable()); }
The only change is this method for remote paging and I have declared it in markup as well
.DataSourceUrl(Url.Action("GetMeasurementGridData"))
Still I am getting error.
Hi Sanjay,
Auto generation of columns depends on the initially supplied data. Internally Infragistics.Web.Mvc.dll inspects the data and generates column definitions. If you didn't pass any data to the view model then the grid outputs the message you're observing.
I guess that your controller doesn't return any data to the view, so you should change it to look like this:
Hope this helps,
Martin Pavlov
Infragistics, Inc.