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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





125012 Jul 14,2016 11:41 AM UTC Jul 18,2016 05:57 AM UTC ASP.NET Web Forms 1
Tags: Grid
Hrvoje Voda
Asked On July 14, 2016 11:41 AM UTC

How can i have an empty grid on page load and refill it later with some search parameters?
Now I', getting an error that grid cannot be empty on load.

Alan Sangeeth S [Syncfusion]
Replied On July 18, 2016 05:57 AM UTC

Hi Hrvoje, 

Thanks for using Syncfusion products. 

Query 1: “empty grid on page load and refill it later” 

We are glad to let you know that we have achieved your requirement and created a sample which can downloadable from below link. 

In the above sample we have not bounded any data to Grid control at initial load. On a button click event, using DataManager we have sent post-back to retrieve data from server-side and we have used addParams” method of ejQuery to send additional parameter. Then in DataManager done event, we have updated data to grid using “dataSource” Grid method. Please refer to the following code example and documentation links. 
<ej:Button ID="ButtonNormal" runat="server" Type="Button" ClientSideOnClick="ButtonNormal_Click" Text="Update Grid"></ej:Button> 
    <ej:Grid ID="EmployeesGrid2" runat="server" AllowPaging="True"> 
        function ButtonNormal_Click(args) { 
            var gridObj = $('#<%= EmployeesGrid2.ClientID %>').data("ejGrid"); 
            var query = new ej.Query().addParams("param23", 5); 
            $('#<%= EmployeesGrid2.ClientID %>').ejWaitingPopup("show"); 
            ej.DataManager({ url: "Default.aspx/DataSource", adaptor: new ej.WebMethodAdaptor()}).executeQuery(query).done(function (e) { 
                $('#<%= EmployeesGrid2.ClientID %>').ejWaitingPopup("hide"); 

Documentation links: 

Query 2: “getting an error that grid cannot be empty on load 

We suspect that you have not defined any Grid columns and loaded empty data which may be the cause of the issue.  

It is necessary to provide either datasource or define Grid columns at initial load. When we do not provide both datasource and Grid columns, it is not feasible to render Grid since there is no information on number of columns and its names. 

Alan Sangeeth S 


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon