hi i am new to kendo Ui i am having trouble in viewing the data in list view although the data is coming to the page ( i have checked it by viewing the source code of the page). Please Help me.
here is View code
@{
ViewBag.Title = "ListView";
}
<link href="../../Content/Kendo/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="../../Content/Kendo/kendo.black.min.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="../../Scripts/Kendo/kendo.all.min.js" type="text/javascript"></script>
<script src="../../Scripts/Kendo/kendo.aspnetmvc.min.js" type="text/javascript"></script>
<h2>ListView</h2>
@(Html.Kendo().ListView(ViewBag.myList).Name("myLV").ClientTemplateId("template").TagName("div").Pageable()
.HtmlAttributes(new { style = "width:400px;Height:400px;background-color:white;" })
)
and this is my Controller
public ActionResult ListView()
{
List<KendoModel> myList = new List<KendoModel>();
for (int i = 1; i <= 100; i++)
myList.Add(new KendoModel { ProductId = "PID" + i, ProductName = "name" + i, BrandName = "Brand" + i, Price = "Brand" + i });
ViewBag.myList = myList;
return View(myList);
}
and i am attaching a file that shows the output of the code -
here is View code
@{
ViewBag.Title = "ListView";
}
<link href="../../Content/Kendo/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="../../Content/Kendo/kendo.black.min.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="../../Scripts/Kendo/kendo.all.min.js" type="text/javascript"></script>
<script src="../../Scripts/Kendo/kendo.aspnetmvc.min.js" type="text/javascript"></script>
<h2>ListView</h2>
@(Html.Kendo().ListView(ViewBag.myList).Name("myLV").ClientTemplateId("template").TagName("div").Pageable()
.HtmlAttributes(new { style = "width:400px;Height:400px;background-color:white;" })
)
and this is my Controller
public ActionResult ListView()
{
List<KendoModel> myList = new List<KendoModel>();
for (int i = 1; i <= 100; i++)
myList.Add(new KendoModel { ProductId = "PID" + i, ProductName = "name" + i, BrandName = "Brand" + i, Price = "Brand" + i });
ViewBag.myList = myList;
return View(myList);
}
and i am attaching a file that shows the output of the code -