This question is locked. New answers and comments are not allowed.
I have the following grid:
Notice I have a column called CouponStatus. I also have an editor template for that column that translates into a dropdown while inline editing:
Now all works fine. Question is, how does one format the <#= CouponStatus #> while using .ClientRowTemplate. For example, how do I call any c# code on it (e.g Enum.Parse(Enum, the actual value of the property)). I tried using CellAction but the DataItem is null. Probably because I'm using AjaxBinding.
Any help is appreciated.
.DataBinding(dataBinding =>
{
dataBinding.Ajax()
.Select("_SelectDriverInfoEditing", "Brand")
.Update("_UpdateDriverInfoEditing", "Brand");
})
.ClientRowTemplate(grid =>
"<div class='employee-details'>" +
"<dl>" +
"<dt>First Name:</dt><dd><#= FirstName #></dd>" +
"<dt>Last Name:</dt><dd><#= LastName #></dd>" +
"</dl><dl class='t-widget'>" +
"<dt>City/State:</dt><dd><#= City #>, <#= StateName #></dd>" +
"<dt>Image count:</dt><#= ImageCount #></dd>" +
"</dl>" +
"</dl><dl class='t-widget'>" +
"<dt>Coupon Status:</dt><dd><#= CouponStatus #></dd>" +
"<dt>Revenue:</dt><dd>$<#= Revenue #></dd>" +
"</dl>" +
"</dl><dn class='t-widget'>" +
"<dt>Notes:</dt><dd><#= Notes #></dd>" +
"</dn>" +
"<div class='commands'>" + grid.EditButton(null, GridButtonType.ImageAndText) + "</div>" +
"</div>"
)
{
dataBinding.Ajax()
.Select("_SelectDriverInfoEditing", "Brand")
.Update("_UpdateDriverInfoEditing", "Brand");
})
.ClientRowTemplate(grid =>
"<div class='employee-details'>" +
"<dl>" +
"<dt>First Name:</dt><dd><#= FirstName #></dd>" +
"<dt>Last Name:</dt><dd><#= LastName #></dd>" +
"</dl><dl class='t-widget'>" +
"<dt>City/State:</dt><dd><#= City #>, <#= StateName #></dd>" +
"<dt>Image count:</dt><#= ImageCount #></dd>" +
"</dl>" +
"</dl><dl class='t-widget'>" +
"<dt>Coupon Status:</dt><dd><#= CouponStatus #></dd>" +
"<dt>Revenue:</dt><dd>$<#= Revenue #></dd>" +
"</dl>" +
"</dl><dn class='t-widget'>" +
"<dt>Notes:</dt><dd><#= Notes #></dd>" +
"</dn>" +
"<div class='commands'>" + grid.EditButton(null, GridButtonType.ImageAndText) + "</div>" +
"</div>"
)
Notice I have a column called CouponStatus. I also have an editor template for that column that translates into a dropdown while inline editing:
@(Html.Telerik().DropDownListFor(m => m) .BindTo(ViewBag.CouponStatuses))Now all works fine. Question is, how does one format the <#= CouponStatus #> while using .ClientRowTemplate. For example, how do I call any c# code on it (e.g Enum.Parse(Enum, the actual value of the property)). I tried using CellAction but the DataItem is null. Probably because I'm using AjaxBinding.
Any help is appreciated.