Multiple grids on same page not showing

Hi,

I have 3 grids of following type- @(Html.EJ().Grid<Object>("FlatGrid")...   on same page, each using different ViewBag as data source. All 3 ViewBags are getting initiated in same action method. But only one grid is getting displayed at one time. Data is getting correctly returned from the controller for all 3 grids. 

Any help appreciated. Thanks in advance.

Regards,
Kaushik

3 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team April 17, 2018 12:31 PM UTC

Hi Kaushik, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we suspect that you want to render three Grid in a single page. We are unable reproduce the reported issue “Only one Grid get rendered in browser” from our end. But we suspect that you may mention same Grid id for the three Grid if so, then give different Grid ID for each. 

Refer the below code example. 

[GridFeatures.cshtml] 

<div> 
    <h1>First Grid</h1> 
    <div> 
        @(Html.EJ().Grid<Object>("FlatGrid") 
        .Datasource((IEnumerable<object>)ViewBag.DataSource) 
        .AllowPaging() 
         
         --- 
 
        ) 
    </div> 
    <br/> 
    <h1>Second Grid</h1> 
    <div> 
        @(Html.EJ().Grid<Object>("FlatGrid2") 
        .Datasource((IEnumerable<object>)ViewBag.DataSource2) 
        .AllowPaging() 
         
        ---- 
 
        ) 
    </div> 
    <br /> 
    <h1>Third Grid</h1> 
    <div> 
        @(Html.EJ().Grid<Object>("FlatGrid3") 
        .Datasource((IEnumerable<object>)ViewBag.DataSource3) 
        .AllowPaging() 
         
         --- 
 
        ) 
    </div> 
    <br /> 
 
</div> 
 
--------------------------------------------------------------- 
[GridController.cs] 

public ActionResult GridFeatures() 
        { 
            ViewBag.DataSource = new NorthwindDataContext().OrdersViews.ToList(); 
            ViewBag.DataSource2 = new NorthwindDataContext().EmployeeViews.ToList(); 
            ViewBag.DataSource3 = new NorthwindDataContext().OrdersViews.ToList(); 
            return View(); 
             
        } 


We have prepared a sample and it can be downloadable from the below location. 


Refer the help documentation. 


Regards, 
Thavasianand S. 



KC Kaushik Chincholikar April 18, 2018 04:40 AM UTC

Hi,


Thanks for the help. That exactly was the issue. 


Regards,
Kaushik


TS Thavasianand Sankaranarayanan Syncfusion Team April 19, 2018 03:55 AM UTC

Hi Kaushik, 
 
We are happy that the problem has been solved. 
 
Please get back to us if you need any further assistance.  
                          
Regards, 
Thavasianand S.                         


Loader.
Up arrow icon