The grid pager doesn't show correctly sometimes

Hello,

The grid  pager doesn't show correctly sometimes. For explane, if you have a tab control with 2 tabs and a grid in each tab, the second grid pager is not rendered correcty (the links to page number doesn't appear). It happens too when the grid is on a Partial View and is rendered intp a bootstrap modal.

Thanks!!!


5 Replies

PK Padmavathy Kamalanathan Syncfusion Team June 22, 2021 02:00 PM UTC

Hi Manuel, 
 
Greetings from Syncfusion Support. 
 
Query : if you have a tab control with 2 tabs and a grid in each tab, the second grid pager is not rendered correcty (the links to page number doesn't appear). 
 
We have created sample and tried to reproduce the reported issue. But we couldn’t reproduce it at our end. We have shared sample for your reference here. You can download the same from the below link, 
 
Also you have mentioned that this issue also occurs while using partial view and rendered in bootstrap model. Kindly share us the below details  so that we could try to reproduce and resolve your issue, 
  1. Your complete Grid rendering code( kindly share us your view, partial view files(as zipped folder) which contain Grid and bootstrap code )
  2. Share us video demo of the issue with issue replication procedure
  3. Share us screenshot of error with complete stack trace (if any)
  4. Also kindly share your Essential Studio version details
  5. If possible share us issue reproducible sample or reproduce the issue in the sample shared above.
 
Regards, 
Padmavathy Kamalanathan 



MC Manuel Caballero June 23, 2021 06:02 AM UTC

Hello,


You can reproduce in the sample if you configure the grids as Responsive:  .IsResponsive(true).

GRID.PNG



PK Padmavathy Kamalanathan Syncfusion Team June 24, 2021 02:04 PM UTC

Hi Manuel, 
 
Thanks for your update. 
 
We can reproduce the issue while enabling the “Responsive” property of Grid. We suggest you to render the Grid in the 2nd tab dynamically (or any tab other than the initially active tab) by following the below steps, 
  1. In below code example, we have rendered Grid in one tab alone. (which is the active tab at initial rendering)
  2. Then in the “Create” event of the tab, we have added new tab item to the tab control using the method, “addItem” by passing the ID of element in which we are going to render Grid (in this case it’s “Grid2” – ID of 2nd grid to be rendered
  3. When we change the tab item, “ItemActive” event will be triggered. In that event, we have checked the active tab’s index value and we have rendered Grid component with Id “Grid2” (id which we passed to addItem method)
  4. Thus the Grid will be properly rendered without having any pager issue.
 
 
<div class="row"> 
 
    <div style="width: 550px"> 
 
        @{Html.EJ().Tab("dish") 
                    .ClientSideEvents(e => { e.ItemActive("itemActive").Create("create"); }) 
                    .Items(data => 
 
                { 
 
           data.Add().ID("grid1").Text("Grid 1") 
                      .ContentTemplate(@<div> 
                        @(Html.EJ().Grid<Object>("Grid1") 
                        .Datasource((IEnumerable<Object>)ViewBag.datasource1).AllowPaging() 
                        .PageSettings(page => page.PageSize(4).PageCount(3)) 
            .Columns(col => 
            { 
                col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true) 
                .TextAlign(TextAlign.Right).Width(75).Add(); 
                col.Field("CustomerID").HeaderText("Customer ID").Width(80).Add(); 
            })) 
 
</div> 
); 
}).ShowCloseButton(true).Render();} 
 
    </div> 
</div> 
<script> 
 
    function create(args) { //tab's create event 
        var tabObj = $(".e-tab").data("ejTab"); // tab instance 
        tabObj.addItem("#new", "Grid", 1, "myClass", "Grid2"); //adding new tab at index 1 
 
    } 
    function itemActive(args) { //tab's itemactive event 
        if (args.activeIndex == 1) { // if tab of index 1 is active 
            $("#Grid2").ejGrid({ // rendering grid inside tab of index 1 
                dataSource: data1, 
                allowPaging: true, 
                isResponsive: true, 
                pageSettings: { pageSize: 2 }, 
                ----------- 
            }); 
 
        } 
    } 
</script> 
 
 
Please check the below screenshot, 
 
 
 
Kindly check the below API help documentations, 
 
Kindly get back to us for further assistance. 
 
Regards, 
Padmavathy Kamalanathan 



MC Manuel Caballero replied to Padmavathy Kamalanathan June 28, 2021 10:41 AM UTC

Hello,


I cannot use that solution becouse I need to create and cofigure the grid in the View Code (Razor).


Is there a solution only with Razor code?


Thanks!



PK Padmavathy Kamalanathan Syncfusion Team June 29, 2021 02:43 PM UTC

Hi Manuel, 
 
Thanks for the update. 
 
Query: Is there a solution only with Razor code? 
 
We have changed Grid rendering in Tab’s itemActive event to Razor code with partial view rendering. On rendering the Grid with partial view in Tab’s itemActive event, we can render Grid’s pager without any issue. We have shared sample for your reference. You can download the same from the below link, 
 
Kindly check if the above solution helps you and get back to us if we have misinterpreted your query. 
 
Regards, 
Padmavathy Kamalanathan 


Loader.
Up arrow icon