Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1730
remote paging error
posted

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.

Parents
No Data
Reply
  • 23953
    Suggested Answer
    Offline posted

    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:

     

    Code Snippet
    1. public ActionResult Index()
    2. {
    3.    // return only the first page of the grid.
    4.    return View(GetTestData().Take(50).AsQueryable());
    5. }
    6. private IEnumerable<testData> GetTestData()
    7. {
    8.    // In this method you should return your test data
    9.    throw new NotImplementedException();
    10. }

     

     

    Hope this helps,

    Martin Pavlov

    Infragistics, Inc.

Children