I am firing a DevExpress Gridivew when a page is requested
@Html.Action("ActionName")
Inside this Actionesult method, the code populates the gridview and I would like to use a viewbag to show the total number of items inside the grid.
// we have the row count - so assign it.
ViewBag.NoOpenItems = List<People>.Count;
return PartialView("GridView", List<People>);
So once the grid is populated and the viewbag assigned, the viewbag doesn't show anything inside it.
<h5>Total @ViewBag.NoOpenItems</h5>
However, when I assign a value to the viewbag inside the main GET Action method on page load, the viewbag value is shown correctly on the page, so I am guessing its to do with assigning the viewbag inside the action method? - Actually as I write this, I am guessing the problem lies with the action method returning a PartialView
?
if so, does anyone know how I can achieve what I like to do?
you can use Gridivew Pager property to show no of record
for more you can visit Devexpress GridView page