How to automatically have the number of rows in a grid displayed below the grid for reference purposes only

Is there a feature that will display the number of rows in a gird. 


For example: 

-------------------------------------------------------
EJS-DATA GRID COLUMN HEADERS
-------------------------------------------------------
row # 1 here | data | data | data |
row # 2 here | data | data | data |
row # 3 here | data | data | data |
row # 4 here | data | data | data |
row # 5 here | data | data | data |
-------------------------------------------------------
                                                  Rows (5)

And when the grid is refreshed it automatically updates the number of rows returned in the update?

1 Reply 1 reply marked as answer

RS Rajapandiyan Settu Syncfusion Team May 6, 2021 11:49 AM UTC

Hi Mike, 

Thanks for contacting Syncfusion support. 
 
Query: Is there a feature that will display the number of rows in a gird. 
 
Based on your query, you want to show the row index in the Grid column. You can achieve your requirement by using columnTemplate feature of EJ2 Grid. 
 
 
In which, you can return the correspond rowIndex to the Grid. Please find the below code example for more information. 
 
[index.cshtml] 
 
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource" width="auto"> 
    <e-grid-columns> 
        <e-grid-column field="rowIndex" headerText="Index" template="#template" width="150"></e-grid-column> 
        ---- 
    </e-grid-columns> 
</ejs-grid> 
 
<script id="template" type="text/x-template"> 
    <div> 
        ${((+data.index)+1)} 
    </div> 
</script> 
 
 
Please get back to us if you need further assistance with this. 
 
Regards, 
Rajapandiyan S 


Marked as answer
Loader.
Up arrow icon