I am trying to find a way to populate a Listview without the need to create a Read action. currently, in my Controller class, I have an action method that gets called with a query string.
Controller.cs
public IActionResult Report(string blocknumber)
{
var model = new List<Report>();
model = _maExtensionService.GetReport(blocknumber).Result.ToList();
ViewBag.BlockList = model;
return View();
}
My cshtml
Report.cshtml
@(Html.Kendo().ListView<Report>(ViewBag.BlockList as IEnumerable<Report>)
.Name("Reportgrid")
.TagName("div")
.Pageable())
I have tried to use ViewBag in different ways and also Viewdata to bind and or hold data to be used on the page. When the page loads I am not seeing data populate the Listview. Is there another way I should be doing this? Thank you for your time