Hey! i am using telerik listview Template for asp.net MVC i want to filter data from server side i.e i enter data in textbox send to action method and filter data and than pass to again view and bind data to listview initially my listview working perfect all data come through database here is my Code
<script type="text/x-kendo-tmpl" id="template">
<div class="col-md-8 jumbotron">
<div class="col-sm-4">
<span><b>Name:</b></span><br />
<span><b>Gender:</b></span><br />
<span><b>DOB:</b></span><br />
<span><b>Country:</b></span><br />
<span><b>Province:</b></span><br />
<span><b>Interset:</b></span><br />
</div>
<img img src="#:Image#" width="100" height="100" />
<div class="col-sm-4">
<span>#:FirstName#</span><br />
<span>#:Gender#</span><br />
<span>#:DOB#</span><br />
<span>#:CountryName#</span><br />
<span>#:ProvinceName#</span><br />
<span>#:Interset#</span><br />
</div>
</div>
</script>
<div class="demo-section k-content wide">
@(Html.Kendo().ListView<Assignment.Models.StudentViewModel>()
.Name("ListView")
.TagName("div")
.ClientTemplateId("template")
.DataSource(dataSource => dataSource
.ServerOperation(true)
.Read(read => read.Action("Get", "Home")
)
)
)
</div>
// here im getting data from server for first load using store procedure now i need to filter data from server side in action method
public JsonResult Get([DataSourceRequest] DataSourceRequest request)
{
var studentData = db.sp_GetStudentData().Select(list => new StudentViewModel
{
FirstName = list.FirstName,
Gender = list.Gender,
DOB = list.DOB.Value.ToShortDateString(),
Image = list.Image,
CountryName = list.Name,
ProvinceName = list.ProvinceName,
Interset = list.Interset
}).ToList();
return Json(studentData.ToDataSourceResult(request));
}