Hi
I tried to use client hierarchy method, first level 'Region Level' and second level "state level". while click region level state level grid bind is happening, but state level details row values are not taken while create client template. why?. please see the code below and let me know where is the problem.
for example child details are
state Total Request Req_sent yes Red_send No +ive% -ive% Request Sent progress bar
AL 18 11 7 20 80 ActionLink1(20% green) Value 11 | ActionLink2(80% red) Value 7
But only parent grid values are taken. please see the below code and point me where is the problem? how to create action link with progress bar style.
@(Html.Kendo().Grid<VAMDEScheduler.Models.RegionModel>()
.Name("Regiongrid")
.Columns(columns =>
{
columns.Bound(r => r.Region).Width(200);
columns.Bound(r => r.TotalRequest).Width(100);
columns.Bound(r => r.ReqSend_Yes).Width(50);
columns.Bound(r => r.ReqSend_No).Width(50);
columns.Bound(r => r.ReqSend_YesP).Width(50).Title("+ive %");
columns.Bound(r => r.ReqSend_NoP).Width(50).Title("-ive %");
columns.Template(@<text></text>).ClientTemplate("<div class='progress' style='height:25px'><a href='/sample1?Category=REQUESTSENT_YES&Region=#=Region#' class='progress-bar progress-bar-success' style='width:#=ReqSend_YesP#%;'><span>#=ReqSend_Yes#</span></a><a href='/sample1?Category=REQUESTSENT_NO&Region=#=Region#' class='progress-bar progress-bar-danger' style='width:#=ReqSend_NoP#%;'><span>#=ReqSend_No#</span></a></div>").Title("Request Sent").Width(100);
}) //columns
.DataSource(dataSource => dataSource.Ajax().Read(read => read.Action("Region_Read", "Home")))
.ClientDetailTemplateId("State_Read_template")
)
<script id="State_Read_template" type="text/x-kendo-template">
@(Html.Kendo().Grid<VAMDEScheduler.Models.StateModel>()
.Name("stategrid") // make sure the Name is unuque
.Columns(columns =>
{
columns.Bound(r => r.State).Width(195);
columns.Bound(r => r.TotalRequest).Width(100);
columns.Bound(r => r.ReqSend_Yes).Width(50);
columns.Bound(r => r.ReqSend_No).Width(50);
columns.Bound(r => r.ReqSend_YesP).Width(50).Title("+ive %");
columns.Bound(r => r.ReqSend_NoP).Width(50).Title("-ive %");
columns.Template(@<text></text>).ClientTemplate("<div class='progress' style='height:25px'><a href='/sample1?Category=REQUESTSENT_YES&State=#=Region#' class='progress-bar progress-bar-success' style='width:#=ReqSend_YesP#%;'><span>#=ReqSend_Yes#</span></a><a href='/sample2/#=ReqSend_No#' class='progress-bar progress-bar-danger' style='width:#=ReqSend_NoP#%;'><span>#=ReqSend_No#</span></a></div>").Title("Request Sent").Width(100);
})
.DataSource(dataSource =>
// Make request to Products_Read and provide the current CategoryID as a route parameter
dataSource.Ajax().Read(read => read.Action("State_Read", "Home", new { region = "#=Region#" }))
)
.Pageable()
.ToClientTemplate()
)
</script>