Hello,
I've got a grid, at the cell change I need to call a store procedure based on the cell changed.... since the grid sends the whole row, is there a way server side to understand which cell has fired the event?
Thanks
Controller
Thanks
I've got a grid, at the cell change I need to call a store procedure based on the cell changed.... since the grid sends the whole row, is there a way server side to understand which cell has fired the event?
Thanks
@(Html.Kendo()
.Grid<
DO.Admin.Utente
>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(x => x.IDDipendente).Visible(false);
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.ForeignKey(x => x.IDProfilo, (System.Collections.IEnumerable)ViewData["ListaProfili"], "ID", "Descr").Title("Profilo");//.EditorTemplateName("StatoTemplate");
columns.ForeignKey(x => x.IDFunzione, (System.Collections.IEnumerable)ViewData["ListaFunzioni"], "ID", "Descr").Title("Funzioni");//.EditorTemplateName("StatoTemplate");
columns.ForeignKey(x => x.IDStato, (System.Collections.IEnumerable)ViewData["ListaStati"], "ID", "Descr").Title("Stato");//.EditorTemplateName("StatoTemplate");
columns.Bound(x => x.AccessoEureka).ClientTemplate("<
input
class'k-checkbox'
type
=
'checkbox'
name
=
'cb#= IDDipendente#'
#= AccessoEureka ? 'checked' : '' # /> ");
})
.Selectable( selectable =>
{
selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row);
})
.ToolBar(toolBar =>
{
toolBar.Save();
})
.Pageable()
.Scrollable()
.Resizable(resize => resize.Columns(true))
.Sortable()
.Filterable()
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Events(events =>
{
events.Change("onRowChange");
//events.Edit("testEdit");
events.Save("testSave");
//events.SaveChanges("testSaveChanges");
})
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.ServerOperation(false)
.Model(model =>
{
model.Id(x => x.IDDipendente);
model.Field(x => x.IDUtente).Editable(false);
model.Field(x => x.Nominativo).Editable(false);
model.Field(x => x.Societa).Editable(false);
model.Field(x => x.Filiale).Editable(false);
//model.Field(x => x.Ruolo);
//model.Field(x => x.Profilo);
//model.Field(x => x.Funzioni);
//model.Field(x => x.Stato);
//model.Field(x => x.AccessoEureka);
})
.Read(read => read.Action("GetListaUtenti", "GestioneUtenti"))
.Update( "UpdateStato", "GestioneUtenti")
.Events(events => events.Error("error_handler"))
)
)
public ActionResult UpdateStato([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<
IDEA20.DO.Admin.Utente
> utenti)
{
if (utenti != null && ModelState.IsValid)
{
//foreach (var utente in utenti)
//{
// //product.Category = GetCategory(product.CategoryID);
// //SessionClientProductRepository.Update(product);
//}
}
return Json(utenti.ToDataSourceResult(request, ModelState));
}