We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to load many data in grid depending of parameters

Thread ID:

Created:

Updated:

Platform:

Replies:

126956 Oct 18,2016 12:48 PM Oct 21,2016 07:21 AM ASP.NET Web Forms 8
loading
Tags: Grid
Roimer Machacón Otero
Asked On October 18, 2016 12:48 PM

Hi, we're using the grid for show a report to the users.

Now in this report we depending of values selected for the users load data in the grid (Attached image of the form).

In the form we've a generate button for bring the data. but here is the problem, when the data is of more of 4200 registers the grid generate an error in the page:

Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Se produjo una excepción en el destino de la invocación.

Our question is, depending of the selected value for the user, exist a form to load many registers o load the registers progressively?

Attachment: form_f9edaf4d.rar

Mani Sankar Durai [Syncfusion]
Replied On October 19, 2016 08:42 AM

Hi Roimer, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we are not able to reproduce the reported issue.  
Based on your requirement we have bound large amount of data to the grid when clicking the button. But the issue is not reproduced.  

We have also prepared a sample that can be downloaded from the below link. 

In this sample we have rendered one dropdown list in the application page and when selecting the value based on that it will bound the data to the grid after clicking the button. 

If you still face the issue please get back to us with the following details. 
1.       Are you using any adaptor to the grid? 
2.       Send the full grid code and the code behind page you have used to render grid. 
3.       Are you using ObjectDataSource to bind the data to grid? 
4.       Share the video to know in what scenario you have faced the issue. 
5.       If possible please replicate the issue in the above attached sample. 
The provided information will help us to analyze the issue and provide you the response as early as possible. 

Regards, 
Manisankar Durai. 


Roimer Machacón Otero
Replied On October 19, 2016 09:47 AM

Hi, the example we couldn't open because is using the version 14.3400.0.49 and modifying to this version appear this error:

Mensaje de error del analizador: La clase base incluye el campo 'selectCar', pero su tipo (Syncfusion.JavaScript.Web.DropDownList) no es compatible con el tipo de control (Syncfusion.JavaScript.Web.DropDownList).

Roimer Machacón Otero
Replied On October 19, 2016 03:29 PM

Hi, attached to this post an example of the error that are presenting, in this example can observe the error that appear in the console browser commented in the start of this post.

Also is a image with the error.

Attachment: WebSiteError_a00cb3d0.rar

Mani Sankar Durai [Syncfusion]
Replied On October 20, 2016 08:53 AM

Hi Roimer, 

We have checked the provided sample and we are able to reproduce the reported issue.  The cause of this issue is due to sending huge amount of data from the server. While serializing those data we have faced the MaxJson length. 
Please refer the below Kb link to avoid this issue. 
So we suggest you to use the URL Adaptor to bind the huge amount of data. 
For you convenience we have modified your sample that can be downloaded from the below link. 
In this sample we have achieved your requirements on button click by passing the URL in the client side of button click and prevented the server side button events. We have passed the URL in the dataSource method of grid using ej.DataManager. 
Now the data will be bound to grid when clicking the button. 
Please refer the below code example. 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> 
<asp:Button ID="btnProcess" runat="server" Text="Read the Data to server" OnClientClick="return Navigate();" OnClick="btnProcessStrategy_Click" UseSubmitBehavior="false" /> 
 
            <ej:Grid ID="Grid" runat="server" AllowPaging="True"> 
                <ClientSideEvents ActionComplete="complete" /> 
                 
            </ej:Grid> 
 
        </ContentTemplate> 
    </asp:UpdatePanel> 
 <script type="text/javascript"> 
      function Navigate() { 
            var obj = $('#<%= Grid.ClientID %>').data("ejGrid"); 
            $("#autoComp").val((selectedvalue)); 
            obj.dataSource(ej.DataManager({ url: "Default.aspx/DataSource", adaptor: new ej.UrlAdaptor() })); 
            
        } 
         
    </script> 
</asp:Content> 
 
 

Also please refer the documentation link about dataSource method. 

Please let us if you need further assistance. 

Regards, 
Manisankar Durai. 


Roimer Machacón Otero
Replied On October 20, 2016 11:18 AM

Hi, the example work correctly, but we've an event QueryCellInfo of the grid that not work with this form to load the data. What can be?

Roimer Machacón Otero
Replied On October 20, 2016 11:34 AM

Hi, the example work correctly, but we've an event QueryCellInfo of the grid that not work with this form to load the data. What can be?

Hi, work correctly, we've a little error. All work Ok. 

Thanks you!

Roimer Machacón Otero
Replied On October 20, 2016 06:04 PM

Hi, adding an new funcionality in the page we've a problem, are using an imagebutton for show a modal popup that generate a postback in the server, but when previously the grid have information, this disappear, appear the grid empty. 

Attached the example modified with the imagebutton added and a video that show what happens.

Attachment: WebSite3_67b6ce1d.rar

Mani Sankar Durai [Syncfusion]
Replied On October 21, 2016 07:21 AM

Hi Roimer, 

We have checked your sample and based on your requirement we have modified your sample that can be downloaded from the below link. 
In this sample we have prevented to bind data to grid at initial rendering and bind the data with the button click. 
During initial post we have prevented the initial post and returns the data to be null. While clicking the button full post will happens and trigger in the server side. After the initial post we makes to return the data to the grid. 
Please refer the below code example. 
[Default.aspx] 
    <ContentTemplate> 
            <asp:HiddenField runat="server" ID="autoComp" ClientIDMode="Static" /> 
            <asp:TextBox runat="server" ID="txt" ClientIDMode="Static"></asp:TextBox> 
            <asp:Button ID="btnProcess" runat="server" Text="Read the Data to server" OnClick="btnProcessStrategy_Click" UseSubmitBehavior="false" /> 
            <asp:ImageButton runat="server" ID="imgModal" OnClick="imgModal_Click" ImageUrl="~/img/estadistica.png" Height="45px" Width="45px" /> 
            <ej:Grid ID="Grid" runat="server" AllowPaging="True"> 
                <DataManager URL="Default.aspx/DataSource" Adaptor="UrlAdaptor" /> 
                <ClientSideEvents ActionComplete="complete" /> 
                <Columns> 
                     
                </Columns> 
            </ej:Grid> 
 
[Default.aspx.cs] 
private static List<Orders> order = new List<Orders>(); 
    public  static Boolean getData = false; 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        if (IsPostBack) 
        { 
            getData = true; 
 
        } 
    } 
 
    [WebMethod] 
    [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
    public static object DataSource(int skip, int take) 
    { 
        if (getData) 
        { 
             
            var res = db.Skip(skip).Take(take).ToList(); 
            return new { result = res, count = db.Count }; 
        } 
        else 
        { 
            var res = new object() { }; 
            return new { result = res, count = 0 }; 
        } 
    } 
 

In the initial post getData Boolean value will be false and it returns empty data to the grid. When clicking the button next post will triggers at the time Boolean value will be true and returns the whole data to the grid. 

Please let us know if you need further assistance. 

Regards, 
Manisankar Durai. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;