Disable EmptyDataSource message

Hi!

I have a grid that loads data like this:
.Datasource(ds => ds.URL(Url.Action("ResourcesDataSource", "Resource")).Adaptor(AdaptorType.UrlAdaptor))

When the datasource is empty, I get this annoying message:
DataSource must not be empty at initial load...

I want to disable this popup, but I don't know how.

Thanks.

4 Replies

PS Pavithra Subramaniyam Syncfusion Team March 30, 2018 12:43 PM UTC

Hi Catalin, 
  
We have checked your query and If you want to use autogenerated columns in Essential JavaScript 2 Grid, it is must to provide dataSource because the columns are generated automatically based on the dataSource. To intimate this the alert will be shown . However you can disable this alert by using following workaround. 
  
[layout.chtml] 
<body> 
    
        <script> 
            window.alert = function () { }; 
        </script> 
        @RenderBody() 
</body> 
  
  
Regards, 
Pavithra S. 



ZO zouzou July 24, 2019 08:56 AM UTC

I am currently facing the same problem. In addition i  couldn't find the layout.chtml file in my project i am working on ASP.NET Web Forms. Thanks for any help.


ZO zouzou July 24, 2019 09:05 AM UTC

I have found a workaround solution. I modified the visible and enabled attributes to false in the aspx grid tag and when i need them in my c# code i remodified them to true in code.


SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team July 25, 2019 06:16 AM UTC

Hi Zouzou,  

Thanks for your update.  

We are happy to hear that your problem has been resolved and you are good to go. P 

Please get back to us, if you require further assistance on this. 

Regards,  
Seeni Sakthi Kumar S. 


Loader.
Up arrow icon