MVC3 I use in Form.cshtml
@Html.DropDownListFor(m => m.GroupID, ViewData["GroupNameDDL"] as SelectList, "-- Select one --") in ControllerViewData["GroupNameDDL"] = _tbl68SpeciesgroupsRepository.Tbl68Speciesgroups.Select(b => new {
Id = b.GroupID, Name = b.GroupName}); TELERIK MVC in EditorTemplate Tbl68SpeciesgroupsForeignKey.cshtml@using System.Collections @using Telerik.Web.Mvc.UI @(Html.Telerik().DropDownList() .Name("GroupNameDDL")in GridViewmodel.cs
.BindTo(new SelectList((IEnumerable)ViewData["GroupNameDDL"], "ID", "Name")))[Required] [UIHint("Tbl68SpeciesgroupsForeignKey")] public int? GroupId { get; set; }How to implementIn Telerik I use in Form.cshtmlcolumns.ForeignKey(b => b.GroupId, (IEnumerable)ViewData["GroupNameDDL"], "ID", "Name");"-- Select one --"
.kendoUpload working fine for Controller Upload call.
like
"public ActionResult UploadImage(HttpPostedFileBase files, string title) { }".columns.Command(command =>
{command.Edit();
command.Custom(
"Details").Text("Line Details").Action("Product", "Home").DataRouteValues(v => v.Add(c => c.SKU).RouteKey("selectSID"));}
);
Corresponding Controller action
public ActionResult Product(string selectSID){
var result = IProductRepository.One(p => p.SID == selectSID);
if (result == null)
{return RedirectToAction("Error");}
else
return PartialView(result);
}
This all works but my Partial View is opened as a full page in the existing window, how can I open this as a popup?
I've tried using JS and kendowindow to open the popup and this does work but I can't see how to pass the SKU from the selected line in the grid so I see my error page loaded in the popup window.
This is my partial view
@model TestKendo.Models.Product
<fieldset>
<div class="display-field">
@Html.DisplayFor(model => model.Description)
</div>
<img src="..\120571.jpg" />
</fieldset>
<p> @Html.ActionLink("Back to List", "Order") </p>
Any and all help appreciated, i've got this far from browsing the forums and sample apps.
@(Html.Kendo().Grid<ToolWarehouseGUI.Models.ToolRowModel>().Name("KendoGridTest").Columns(columns => { columns.Bound(p => p.Name).Title("Nimike"); columns.Bound(p => p.Description).Title("Kuvaus"); columns.Bound(p => p.AmountAvailable).Title("Varastossa"); columns.Bound(p => p.AmountBooked).Title("Lainassa"); columns.Template(@<text> <a class="link-button" href="@Url.Action("Edit", new {toolid=item.ToolId})"> <span class="add-item">Muokkaa</span> </a> <a class="link-button" href="@Url.Action("Details", new {toolid=item.ToolId})"> <span class="add-item">Lisätiedot</span> </a> </text>) .ClientTemplate("<a class=\"link-button\" href=\"" + Url.Action("Edit", "Warehouse") + "?toolId=#=ToolId#" + "\">" + "<span class=\"add-item\">Muokkaa</span>" + "</a>" + "<a class=\"link-button\" href=\"" + Url.Action("Details", "Warehouse") + "?toolId=#=ToolId#" + "\">" + "<span class=\"add-item\">Lisätiedot</span>" + "</a>") .Title("Toiminnot"); }).DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("GetTools", "Warehouse") .Type(HttpVerbs.Post) )).Filterable(filtering => filtering .Enabled(true) ).ToolBar(factory => factory .Template(@<text> <div> Hakusana: @Html.TextBox("SearchText") <button id="searchBtn" class="ui-state-default ui-corner-all" type="submit">Hae</button> </div> </text>)))<script> function refreshGrid() { $filter = new Array(); $filter.push({ field: "Name", operator: "contains", value: $('#SearchText').val() }); var grid = $("#KendoGridTest").data("kendoGrid"); grid.dataSource.filter($filter); grid.dataSource.read(); } $('#searchText').on("keypress", function(e) { var code = (e.keyCode ? e.keyCode : e.which); if (code == 13) { refreshGrid(); return false; } }); $('#searchBtn').on("submit", function(e) { refreshGrid(); return false; });</script> @(Html.Kendo().ListView<ReportTypeViewModel>().Name("listView").TagName("ul").DataSource(ds => ds.Read(read => read.Url("/api/ReportApi/List").Type(HttpVerbs.Get))).ClientTemplateId("templateReportList")).ListView<ReportTypeViewModel>(types)"/api/ReportApi/List" is MVC 4 web api.function initList() { $("#listview").kendoMobileListView({ template: "<a><span>${data.Name}</span></a>", dataSource: new kendo.data.DataSource({ transport: { read: "/api/ReportApi/List", type: "json" }, }), style: "inset" }); }