Hello,
I'm going further in my KendoUI discovery... I wish to have a DropDownList while editing a cell on a certain column
my grid is :
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%: Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(x => x.IDUtente);
columns.Bound(x => x.Nominativo);
columns.Bound(x => x.Societa);
columns.Bound(x => x.Filiale);
columns.Bound(x => x.Ruolo);
columns.Bound(x => x.IDStato).Hidden();
columns.Bound(x => x.Stato).ClientTemplate("StatoID");
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Groupable()
// .Pageable()
.Sortable()
.Scrollable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax().Model(model => model.Id(p => p.IDUtente))
.ServerOperation(false)
.Read(read => read.Action("GetListaUtenti", "Administration")
)
)
%>
</asp:Content>
and I've created an ascx called StatoID with
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<int>" %>
<%:@(Html.Kendo().DropDownListFor(m => m).BindTo(new List<SelectListItem>() {
new SelectListItem() {
Text = "Enabled",
Value = "1"
},
new SelectListItem() {
Text = "Disabled",
Value = "0"
}
}).Value(1)
%>
I don't understand where I say to the Grid when in edit use that template...I've downloaded http://www.kendoui.com/code-library/mvc/grid/grid-inline-and-popup-editing-using-cascading-dropdownlists.aspx but it's razor and I'm using ASPX ... anyone can help me?
I wish those data to be loaded from the Controller
I've just got a method (first it would just be enougth to load statically),later my method will be
[HttpPost]
public ActionResult GetStati([DataSourceRequest] DataSourceRequest request, int idUser)
{
DataAccessAdministration da = new DataAccessAdministration(Global.IDApplication, IDIstituto);
var res = da.GetStati(idUser);
return Json(res.ToDataSourceResult(request));
}
Please help me thanks!
I'm going further in my KendoUI discovery... I wish to have a DropDownList while editing a cell on a certain column
my grid is :
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%: Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(x => x.IDUtente);
columns.Bound(x => x.Nominativo);
columns.Bound(x => x.Societa);
columns.Bound(x => x.Filiale);
columns.Bound(x => x.Ruolo);
columns.Bound(x => x.IDStato).Hidden();
columns.Bound(x => x.Stato).ClientTemplate("StatoID");
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Groupable()
// .Pageable()
.Sortable()
.Scrollable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax().Model(model => model.Id(p => p.IDUtente))
.ServerOperation(false)
.Read(read => read.Action("GetListaUtenti", "Administration")
)
)
%>
</asp:Content>
and I've created an ascx called StatoID with
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<int>" %>
<%:@(Html.Kendo().DropDownListFor(m => m).BindTo(new List<SelectListItem>() {
new SelectListItem() {
Text = "Enabled",
Value = "1"
},
new SelectListItem() {
Text = "Disabled",
Value = "0"
}
}).Value(1)
%>
I don't understand where I say to the Grid when in edit use that template...I've downloaded http://www.kendoui.com/code-library/mvc/grid/grid-inline-and-popup-editing-using-cascading-dropdownlists.aspx but it's razor and I'm using ASPX ... anyone can help me?
I wish those data to be loaded from the Controller
I've just got a method (first it would just be enougth to load statically),later my method will be
[HttpPost]
public ActionResult GetStati([DataSourceRequest] DataSourceRequest request, int idUser)
{
DataAccessAdministration da = new DataAccessAdministration(Global.IDApplication, IDIstituto);
var res = da.GetStati(idUser);
return Json(res.ToDataSourceResult(request));
}
Please help me thanks!