Hello,
I'm currently trying to implement an ASP.NET MVC Grid that hosts products and displays additional product information via detail rows. The additional information in the detail row is depending on the product group (e.g. products of productgroup 1 should display additonal information a, b and c and products of productgroup 2 should display additonal information d, e and f). I tried to implement this using ClientDetailTemplateId combined with Partial Views:
<script id=
"template"
type=
"text/html"
>
# if(Productgroup == "Productgroup1") { #
@{ Html.RenderPartial(
"Partial/Productgroup1View"
); }
# } else if(Productgroup == "Productgroup2") { #
@{ Html.RenderPartial(
"Partial/Productgroup2View"
); }
# } else { #
@{ Html.RenderPartial(
"Partial/DefaultView"
); }
# } #
</script>
In the partial views in want to use a NumericTextBox to display product information like:
@(Html.Kendo().NumericTextBox()
.Value("#= NumericProductProperty1 #")
.Name("NumericProductProperty1"))
As the Value property of a numeric textbox needs a decimal this is not working.
Is there any way to solve my problem? Is there a possibility to use early bound properties in client templates? In general: Is ClientTemplateId the recommended way to implement my requirements?
I tried to solve my problem using a server-side DetailTemplate but this is not working with an Ajax datasource.
Any help is appreciated!
Regards
Raphael