or
@(Html.Kendo().Window()
.Name("window")
.Content(@<
text
>
@(Html.Kendo().Upload()
.Name("files")
)
</
text
>)
.Draggable()
.Resizable()
.Width(600)
)
How can I change the fields that display for an Add/Update? For an add I need to have 4 fields display and for an edit I need to only display 2. I tried creating a template usercontrol but it is showing up for both an add/update. I tried modifying the viewmodel and that is applying the changes to both the add/update also.
Grid:
@(Html.Kendo().Grid(Model)
.Name("CodeManager")
.Columns(columns =>
{
columns.Bound(p => p.CodeID);
columns.Bound(p => p.Status);
columns.Command(command => { command.Edit(); }).Width(200);
})
.ToolBar(toolBar => toolBar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.Sortable()
.Scrollable()
.Groupable()
.Pageable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("error_handler"))
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.CodeID);
model.Field(p => p.CodeID).Editable(false);
model.Field(p => p.Title).Editable(false);
})
//.Read(read => read.Action("GetPersons", "CodeManager", new { classifications = @ViewBag.SelectedCatgory }))
.Update(update => update.Action("EditingCustom_Update", "CodeManager"))
.Create(update => update.Action("EditingCustom_Update", "CodeManager"))
)
.Editable(ed => ed.Mode(GridEditMode.PopUp).TemplateName("_CodeEditor"))
)
Control:
public ActionResult Index(string classifications = "")
{
ViewData["Category"] = classifications;
ViewData["Classifications"] = new SelectList(Classifications.List, "ClassificationText", "ClassificationText", classifications);
var codModels = new List<
CodeModel
>();
ViewBag.SelectedCatgory = classifications ?? "Type";
if (Request.HttpMethod == "POST")
{
var model = _codeRepository.Search(classifications).ToModel();
return View(model);
}
return View(codModels);
}
Model:
blic class CodeModel
{
public string CodeID { get; set; }
public string Title { get; set; }
public string Status { get; set; }
public bool Active { get; set; }
public string Category { get; set; }
public int UserID { get; set; }
}
Thanks
Dennis
if
($.browser.msie) {
var
oldFxPlay = $.telerik.fx.play;
$.telerik.fx.play =
function
() {
var
target = $(arguments[1]);
if
(target.is(
".t-menu .t-group"
) && !target.find(
"iframe"
).length) {
target.append(
"<li style='width:100%;height:100%;z-index:-1;position:absolute;top:0;left:0;'>"
+
"<iframe src='#' frameborder='0' style='width:100%;height:100%;z-index:-1;position:absolute;'></iframe>"
+
"</li>"
);
}
oldFxPlay.apply(
this
, Array.prototype.slice.apply(arguments));
};
}