I one one modal window with telerik grid inside. But i need to render images in my grid so as i understand i cant use @ twice. Here is blog post about this issue Link
<
In these situations the MVC Razor helper function can be used.
Create the helper function with the grid control definition, in this case RenderGrid()
.
@helper RenderGrid()
{
@(Html.Telerik().Grid()
.Name("Grid")
.DataKeys(keys => keys.Add(c => c.ID))
.Columns(columns =>
{
columns.Template(
@
).Title("Picture");
})
.DataBinding(dataBinding => dataBinding.Ajax().Select("GetImages", "UserProducts"))
}
Call the helper function inside the window's content definition. The helper functions can be called multiple times if needed.
@{Html.Telerik().Window()
.Name("images")
.Title("Select an Image")
.Content(
@
@RenderGrid()
)
.Width(400)
.Draggable(true)
.Modal(true)
.Visible(false)
.Render();
}