This is a migrated thread and some comments may be shown as answers.

Problem with Editable GridEditMode.PopUp

1 Answer 244 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Pablo asked on 19 Jul 2014, 07:05 PM
I have this code in my page

        .Columns(columns =>
            columns.Bound(c => c.Titulo);
            columns.Command(command => { command.Edit(); command.Destroy(); });
        .ToolBar(toolbar => toolbar.Create())
        .Editable(editable =>
        .ColumnMenu(p => p.Columns(false))
        .Filterable().Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
        .Sortable(sortable => sortable.AllowUnsort(false))
        .Pageable(pageable => pageable
        .PageSizes(new[] { 5, 10, 25, 50 }))
        .DataSource(dataSource => dataSource
                .Model(model =>
                    model.Id(p => p.Id);
                    model.Field(p => p.Id).Editable(false);
                .Create(create => create.Action(MVC.Libro.ActionNames.Create, MVC.Libro.Name))
                .Read(read => read.Action(MVC.Libro.ActionNames.GetLibros, MVC.Libro.Name))
                .Update(update => update.Action(MVC.Libro.ActionNames.Edit, MVC.Libro.Name))
                .Destroy(destroy => destroy.Action(MVC.Libro.ActionNames.Delete, MVC.Libro.Name))
With this ViewModel    

public class LibroViewModelwith 
        public int Id { get; set; }
        public string Titulo { get; set; }
        public DateTime Creado { get; set; }
        public DateTime Modificado { get; set; }

When I click in Add a new row the popup appears with all the properties of the view model, but I dont want to show all this properties, I want only to present the Titulo. How I can do this. 

1 Answer, 1 is accepted

Sort by
Dimiter Madjarov
Telerik team
answered on 21 Jul 2014, 10:52 AM
Hello Pablo,

By design all model fields are shown in the PopUp editor. There a multiple resolutions to the current issue:
  • Include only the required fields for the Grid in the currently used ViewModel
  • Use the edit event handler in order to access the editor container (e.container parameter) and hide the unnecessary editor inputs.
  • Define a custom PopUp editor as demonstrated in the following Code Library.

I hope this information helps.

Dimiter Madjarov

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Asked by
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question