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. Image for the cookie policy date

Poluate grid with stored procedure

Hi all,

It's possible populate a ej-grid with a stored procedure?

thanks,
Nicholas

3 Replies

VA Venkatesh Ayothi Raman Syncfusion Team January 11, 2017 11:24 AM UTC

Hi Nicholas, 

Thanks for contacting Syncfusion support. 

The Grid will populate the data in the form of IEnumerable. we can retrieve the data source from stored procedure and change the stored procedure result as IEnumerable and then bound the data to Grid its works normally. Please refer to the following code example and online forum, 
Code example
[GRID] 
<ej-grid id="FlatGrid" datasource="ViewBag.dataSource" allow-paging="true" load="onLoad" > 
 
        <e-columns> 
        . . . 
</e-columns> 
</ej-grid> 
 
[Server side] 
public IActionResult Index() 
        { 
 
            IEnumerable data; 
             
            //Get the data source from stored procedure 
 
            ViewBag.dataSource = data;  
            return View(); 
 
        } 
 
Online reference

Regards, 
Venkatesh Ayothiraman. 



NP Nicholas Picardi January 11, 2017 11:31 AM UTC

Hi Venkatesh,

Thanks for the code.
It is what i needed.

Regards,
Nicholas


MF Mohammed Farook J Syncfusion Team January 12, 2017 09:12 AM UTC

Hi Nicholas, 
  
Thanks for update. 
  
Regards, 
J.Mohammed Farook 


Loader.
Live Chat Icon For mobile
Up arrow icon