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
15
IGGrid remote pagination in in aspx.vb.Need
posted

IGGrid  remote pagination in in aspx.vb.

How to get the pageno,pagesize etc on aspx.vb code and what should be response format to bind data in grid.

  • 1300
    Offline posted

    Hello,

    After investigating this further, I determined that the igGrid could be bound to data from aspx.vb file using PageMethods as follows:

    function callservermethod() {

                 PageMethods.GetCollection(OnSuccess, OnFailure);

             }

    function OnSuccess(result) {

         if (result) {

              let data = [];

              for (let i = 0; i < result.length; i++) {

                 data.push({ First: result[i].First, Last: result[i].Last, Year: result[i].Year });         

              }

              $("#grid").igGrid({

                    dataSource: data,

                    width: "500px",

                    . . .

               });

          }

      }

    Additionally, the pageSize and currentPageIndex could be accessed by using hidden inputs. In the client-side click method the value of these hidden inputs would be set to the pageSize and currentPageIndex and in the server-side method the value would be accessed:

    <input type="hidden" id="PageSize" runat="server"/>

    <input type="hidden" id="PageIndex" runat="server"/>

     

    function GetValues() {

        document.getElementById("PageSize").value = $("#grid").igGridPaging("option", "pageSize");

        document.getElementById("PageIndex").value = $("#grid").igGridPaging("option", "currentPageIndex");

    }

    Protected Sub Values(ByVal sender As Object, ByVal e As EventArgs)

        Dim pageSizeVal = PageSize.Value

        Dim pageIndxVal = PageIndex.Value

    End Sub

    Below I am attaching a sample, demonstrating the described behavior. Please test it on your side and let me know if  this is the project type which you are using or if the project structure is Asp.Net MVC.

    Regards,
    Monika Kirkova,
    Infragistics

    igGridAsp.zip