1

In my editor for insert telerik show only common textbox (not integer,decimal etc).

this is my view:

@(Html.Telerik().Grid <GamePlayer2>(Model).Name("za11").DataKeys(keys => keys.Add(c => c.Id))
.ToolBar(commands => commands.Insert()
.ButtonType(GridButtonType.ImageAndText))
.DataBinding(dataBinding => dataBinding.Server()
        .Insert("PlayerAdd", "Player", new { })
        .Update("PlayerUpdate", "Player", new { })
        .Delete("PlayerDelete", "Player", new { })
)
.Columns(columns =>
             {
                 columns.Bound(b => b.Name);
                 columns.Bound(b => b.Price);

                 columns.Command(commands =>
                 {                    
                     commands.Edit();
                     commands.Delete();
                 }).Width(200);

             })
.Editable(editing => editing.Mode(GridEditMode.PopUp)))

model:

public class GamePlayer2
{
    public int Id { get; set; }
    public string Name { get; set; }
    [DataType(DataType.Currency)]
    public decimal Price{ get; set; }
}

Scripts are registered on _Layout. Where is a problem? Why currency(integer,date etc) textbox won't display for fields?

4

1 回答 1

0

确保您已在Shared/EditorTemplates文件夹下添加 EditorTemplates 。基本上,如果您使用向导创建项目,它们会自动添加。如果没有创建一个演示项目并从那里复制粘贴它们。

于 2012-04-19T17:54:03.753 回答