This question is locked. New answers and comments are not allowed.
I'm trying to create a client template with a Menu control.
I'm binding my grid using Ajax and Razor.
Is this possible or should I switch to server and use Templates?
Thanks,
Brian
I'm binding my grid using Ajax and Razor.
Is this possible or should I switch to server and use Templates?
Thanks,
Brian
4 Answers, 1 is accepted
0
Accepted
0
bbeatty
Top achievements
Rank 1
answered on 15 Mar 2012, 09:21 PM
That worked well.
How would I have conditional items in the menu?
ex:
columns.Bound(m => m.Id).ClientTemplate(
Html.Telerik().Menu()
.Name("Menu1_<#=Id #>").HtmlAttributes(new { style = "z-order:100000000" })
.Orientation(MenuOrientation.Vertical)
.Items(menu => menu.Add().Text("Actions")
.Items(sub =>
{
sub.Add().Text("Notify");
//If FieldX == ValueA then sub.Add().Text("Continue ");
//if fieldZ == ValueB then sub.Add().Text("Take ");
}))
.ToHtmlString()
);
How would I have conditional items in the menu?
ex:
columns.Bound(m => m.Id).ClientTemplate(
Html.Telerik().Menu()
.Name("Menu1_<#=Id #>").HtmlAttributes(new { style = "z-order:100000000" })
.Orientation(MenuOrientation.Vertical)
.Items(menu => menu.Add().Text("Actions")
.Items(sub =>
{
sub.Add().Text("Notify");
//If FieldX == ValueA then sub.Add().Text("Continue ");
//if fieldZ == ValueB then sub.Add().Text("Take ");
}))
.ToHtmlString()
);
0
Dadv
Top achievements
Rank 1
answered on 16 Mar 2012, 09:16 AM
I don't know if it is possible, this is probably the same behavior than here, and you should consider the context.
If the menu item is a security risk then you should bind it to a Model and extract the value from the server otherwise if it's a simple visual effect then you could do it in jquery via the client side API (use OnRowDataBound of the grid for example).
If the menu item is a security risk then you should bind it to a Model and extract the value from the server otherwise if it's a simple visual effect then you could do it in jquery via the client side API (use OnRowDataBound of the grid for example).
0