hakan648
شنبه 03 دی 1390, 15:42 عصر
سلام
من ازکامپوننت Telerik استفاده میکنم ( در MVC ) .
هنگام ارسال مدل به Grid ارور زیر رو میگیرم :
=====
http://up7.iranblog.com/images/zqqv1w1ojyslboe7omho.png
======
PhoneBookController :
public ActionResult Index()
{
PhoneBookContext db = new PhoneBookContext();
return View(db.Contact);
}
Index.cshtml :
@model IEnumerable<Sample.Models.Contact>
@(Html.Telerik().Grid(Model)
.Name("Grid")
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Image) .ImageHtmlAttributes(new { style = "margin-right:3px" }))
.DataBinding(x =>
{
x.Ajax().Select("_Select", "PhoneBook");
}
)
.DataKeys(keys => keys.Add(c => c.ID))
.Columns(columns =>
{
columns.Bound(o => o.FirstName).Title("نام").Width(100);
columns.Bound(o => o.LastName).Title("نام خانوادگی").Width(200);
columns.Bound(o => o.Mobile).Title("تلفن");
columns.Command(commands =>
{
commands.Edit().ButtonType(GridButtonType.Image).I mageHtmlAttributes(new { style = "margin-right:3px" });
commands.Delete().ButtonType(GridButtonType.Image) .ImageHtmlAttributes(new { style = "margin-right:3px" });
}).Width(180);
})
.Editable(editing => editing.Mode(Telerik.Web.Mvc.UI.GridEditMode.PopUp ))
.Sortable(sorting => sorting.Enabled(true))
.Selectable()
.Footer(true)
)
دوستان و استید گرامی لطفا راهنمایی بفرمایید .:قلب:
من ازکامپوننت Telerik استفاده میکنم ( در MVC ) .
هنگام ارسال مدل به Grid ارور زیر رو میگیرم :
=====
http://up7.iranblog.com/images/zqqv1w1ojyslboe7omho.png
======
PhoneBookController :
public ActionResult Index()
{
PhoneBookContext db = new PhoneBookContext();
return View(db.Contact);
}
Index.cshtml :
@model IEnumerable<Sample.Models.Contact>
@(Html.Telerik().Grid(Model)
.Name("Grid")
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Image) .ImageHtmlAttributes(new { style = "margin-right:3px" }))
.DataBinding(x =>
{
x.Ajax().Select("_Select", "PhoneBook");
}
)
.DataKeys(keys => keys.Add(c => c.ID))
.Columns(columns =>
{
columns.Bound(o => o.FirstName).Title("نام").Width(100);
columns.Bound(o => o.LastName).Title("نام خانوادگی").Width(200);
columns.Bound(o => o.Mobile).Title("تلفن");
columns.Command(commands =>
{
commands.Edit().ButtonType(GridButtonType.Image).I mageHtmlAttributes(new { style = "margin-right:3px" });
commands.Delete().ButtonType(GridButtonType.Image) .ImageHtmlAttributes(new { style = "margin-right:3px" });
}).Width(180);
})
.Editable(editing => editing.Mode(Telerik.Web.Mvc.UI.GridEditMode.PopUp ))
.Sortable(sorting => sorting.Enabled(true))
.Selectable()
.Footer(true)
)
دوستان و استید گرامی لطفا راهنمایی بفرمایید .:قلب: