Hi,
I'm working with telerik grid and using a custom modelview element to pass the data to the controller, when the user presses the Edit button inside the grid it should display the modelview item information or at least the information I want it to show, but so far just errors and an inconsistent look and feel when I use telerik controllers,
I've configured the Edit command to only show all fields of my viewmodel except the item id, but every time it keeps showing the item id,
This is my modelview item class
public
class
EmpleadoViewModel
{
public
int
EmpleadoID {
get
;
set
; }
[Required]
public
String Nombre {
get
;
set
; }
[Required]
public
String Email {
get
;
set
; }
[Required]
public
String Activo {
get
;
set
; }
[Required]
public
String Role {
get
;
set
; }
}
This is the grid settings
@(Html.Kendo().Grid<EmpleadoViewModel>()
.Name(
"people_grid"
)
.Columns(columns =>
{
columns.Bound(e => e.Nombre).Title(
"Nombres"
).HeaderHtmlAttributes(
new
{ style =
"text-align:center"
});
columns.Bound(e => e.Email).Title(
"E-Mail"
).HeaderHtmlAttributes(
new
{ style =
"text-align:center"
});
columns.Bound(e => e.Activo).Title(
"Estado"
).HeaderHtmlAttributes(
new
{ style =
"text-align:center"
});
columns.Bound(e => e.Role).Title(
"Rol de sitio"
).HeaderHtmlAttributes(
new
{ style =
"text-align:center"
});
columns.Command(command =>
{
command.Edit().Text(
"Editar"
).HtmlAttributes(
new
{ @
class
=
"sharp"
, onmouseover =
"editBtnPopover(this)"
, onmouseout=
"hidePopover(this)"
});
command.Custom(
"Deshabilitar"
).Click(
"disablePerson"
).HtmlAttributes(
new
{ @
class
=
"sharp"
, onmouseover =
"disableBtnPopover(this)"
, onmouseout =
"hidePopover(this)"
});
}).Title(
"Acciones"
).HeaderHtmlAttributes(
new
{ style =
"text-align:center"
});
})
.ToolBar(toolbar =>
{
toolbar.Create().Text(
"Nuevo"
).HtmlAttributes(
new
{ id=
"new_btn"
});
})
.HtmlAttributes(
new
{ style =
"height:550px;"
})
.Editable(editable =>
editable.Mode(GridEditMode.PopUp).Window(window =>
{
window.Draggable(
false
);
window.Title(
"ICS: Personas"
);
}))
.Scrollable()
.Sortable()
.Pageable(pageable =>
{
pageable.Refresh(
false
);
pageable.PageSizes(
true
);
pageable.ButtonCount(5);
})
.Events(events => events.Change(
"getSelectedItem"
))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Model(model =>
{
model.Id(emp => emp.EmpleadoID);
model.Field(emp => emp.EmpleadoID).Editable(
false
);
})
.Create(update => update.Action(
"EditingPopup_Create"
,
"Grid"
))
.Read(read => read.Action(
"Read_Alpes_Employees"
,
"Demo"
))
.Update(update => update.Action(
"EditingPopup_Update"
,
"Grid"
))
.Destroy(update => update.Action(
"EditingPopup_Destroy"
,
"Grid"
))
)
)
So far I'm very unhappy with your product, I can't modify certain things and also every time I use telerik it messes my whole page design!!!!