This question is locked. New answers and comments are not allowed.
Hello,
I've tried to find a solution in other threads in here but didn't. My problem is that I cannot hide property from inserting/editing popup window (I still wanna see column in grid). I've tried to use attribute ReadOnly (Model) and I also tried to set column to readonly (View). Everything works fine in InLine Mode but in popup mode I still see columns Created and Modified. Is there any way how to hide these two columns from popup?
Here is my model:
Here is my View:
Thank you for any suggestions, best regards Ivan.
I've tried to find a solution in other threads in here but didn't. My problem is that I cannot hide property from inserting/editing popup window (I still wanna see column in grid). I've tried to use attribute ReadOnly (Model) and I also tried to set column to readonly (View). Everything works fine in InLine Mode but in popup mode I still see columns Created and Modified. Is there any way how to hide these two columns from popup?
Here is my model:
using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System; using System.Runtime.Serialization; namespace Models { /// <summary> /// Kraj - offline model /// </summary> public class RegionModel { #region Properties /// <summary> /// Gets or sets the id. /// </summary> /// <value> /// The id. /// </value> [ScaffoldColumn(false)] public int ID { get; set; } /// <summary> /// Gets or sets the name. /// </summary> /// <value> /// The name. /// </value> [Required] [DisplayName("Název")] public string Name { get; set; } /// <summary> /// Gets or sets the code. /// </summary> /// <value> /// The code. /// </value> [DisplayName("Kód")] public string Code { get; set; } /// <summary> /// Gets the created. /// </summary> [ReadOnly(true)] public DateTime Created { get; private set; } /// <summary> /// Gets the modified. /// </summary> [ReadOnly(true)] public DateTime Modified { get; private set; } #endregion } }Here is my View:
@{ ViewBag.Title = "Index"; } <h2> Index</h2> <p> @( Html.Telerik().Grid<Models.RegionModel>() .Name("Grid") .DataKeys(keys => keys.Add(c => c.ID)) .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Image)) .DataBinding(dataBinding => { dataBinding.Ajax() .Select("Select", "Region") .Insert("Create", "Region") .Update("Edit", "Region") .Delete("Delete", "Region"); }) .Columns(columns => { columns.Bound(o => o.ID); columns.Bound(o => o.Name).Title("Název"); columns.Bound(o => o.Code).Title("Kód"); columns.Bound(o => o.Created).Title("Vytvořenà objektu"); columns.Bound(o => o.Modified).Title("Poslednà uložená změna"); columns.Command(commands => { commands.Edit().ButtonType(GridButtonType.Image); commands.Delete().ButtonType(GridButtonType.Image); }).Width(80).Title("Akce"); }) .Editable(editing => editing.Mode(GridEditMode.PopUp)) .Sortable() .Pageable() .Filterable() ) </p> Thank you for any suggestions, best regards Ivan.