This question is locked. New answers and comments are not allowed.
Hi,
I think I have tried every possible way now to show the template but nothing works! :(
I have this model:
And I have a editor template, DropDownList.ascx with the dropdownlist.
The grid looks like this:
But when I edit a row in the grid it just showing the textbox for ResourceName but no dropdownlist for the Client.
Any ideas why?
Regards,
Mattias
I think I have tried every possible way now to show the template but nothing works! :(
I have this model:
public class Resource{ [ScaffoldColumn(false)] public virtual Guid ID { get; private set; } [Required(ErrorMessage="Namn obligatorisk")] [StringLength(128)] [DisplayName("Namn")] [UIHint("TextBoxLarge")] public virtual string ResourceName { get; set; } [Required(ErrorMessage = "Klient obligatorisk")] [DisplayName("Klient")] [UIHint("DropDownList")] public virtual Client Client { get; set; }}And I have a editor template, DropDownList.ascx with the dropdownlist.
The grid looks like this:
<% Html.Telerik().Grid(Model) .Name("Grid") .DataKeys(keys => keys.Add(x => x.ID).RouteKey("id")) .ToolBar(commands => commands.Insert()) .DataBinding(dataBinding => { dataBinding.Server() .Select("Index", "Resource") .Insert("Insert", "Resource") .Update("Update", "Resource") .Delete("Delete", "Resource"); }) .Editable(editing => editing.Mode(GridEditMode.InForm)) .Columns(columns => { columns.Bound(x => x.ResourceName).Title(Resources.Shared.Resource); columns.Bound(x => x.Client.ClientName).Title(Resources.Shared.Client); columns.Bound(x => x.City.CityName).Title(Resources.Shared.City); columns.Bound(x => x.CreateDate).Title(Resources.Shared.CreateDate).ReadOnly(); columns.Command(commands => { commands.Edit(); commands.Delete(); }).Width(180).Title("").HtmlAttributes(new { @style = "text-align:right" }); }) .Render(); %>But when I edit a row in the grid it just showing the textbox for ResourceName but no dropdownlist for the Client.
Any ideas why?
Regards,
Mattias