Note that there are some explanatory texts on larger screens.

plurals
  1. POInsert action in telerik grid in mvc 3
    primarykey
    data
    text
    <p>Why when i click insert button in grid, action don't called. I set breakpoint in action but action don't called. This is my action:</p> <pre><code>[AcceptVerbs(HttpVerbs.Get)] [GridAction] public ActionResult _InsertAjaxEditing() { return View(); } [AcceptVerbs(HttpVerbs.Post)] [GridAction] public ActionResult _InsertAjaxEditing(Employee e) { bus = new SysBusContext(); string error = null; IEnumerable&lt;Employee&gt; emps = null; if (e != null) if (e.EmployeeId != null) { try { Employee emp = new Employee(); emp = e; bus.Employees.Add(emp); bus.SaveChanges(); } catch { } } emps = bus.Employees.ToList(); return View("EmpSave", emps); } </code></pre> <p>and this is my view : </p> <pre><code>&lt;div class="t-rtl"&gt; @(Html.Telerik().Grid&lt;TelerikMvcApplication3.Models.Employee&gt;() .Name("Grid") .DataKeys(keys =&gt; { keys.Add(p =&gt; p.EmployeeId); }) .ToolBar(commands =&gt; commands.Insert().ButtonType(GridButtonType.ImageAndText). ImageHtmlAttributes(new {style="margin-Right:0"})) .DataBinding(dataBinding =&gt; { dataBinding.Ajax() .Select("_SelectAjaxEditing", "CtrlEmployee") .Insert("_InsertAjaxEditing", "CtrlEmployee") .Update("_SaveAjaxEditing", "CtrlEmployee") .Delete("_DeleteAjaxEditing", "CtrlEmployee"); }) .Columns(columns =&gt; { columns.Bound(p =&gt; p.EmployeeId).Width(95); columns.Bound(p =&gt; p.FirstName).Width(50).Sortable(true); columns.Bound(p =&gt; p.LastName).Width(50).Sortable(true); columns.Bound(p =&gt; p.Recruitment).Width(70);//.ClientTemplate(@Html.Telerik().DatePicker(); columns.Bound(p =&gt; p.Email).Width(100).Format("{0:d}"); columns.Bound(p =&gt; p.PhoneNumber).Width(65); columns.Bound(p =&gt; p.Type).Width(50); columns.Command(commands =&gt; { commands.Edit().ButtonType(GridButtonType.ImageAndText); commands.Delete().ButtonType(GridButtonType.ImageAndText); }).Width(180).Title("ویرایش"); }).ClientEvents(e =&gt; e .OnDataBinding( @&lt;text&gt; function(a) { a.data = $.extend(a.data,{ dropdownlist: $('#dropdownlist').val()}); } &lt;/text&gt;) ) .Editable(t =&gt; t.Mode(GridEditMode.PopUp)) .Pageable() .Scrollable() .Sortable() ) &lt;/div&gt; @section HeadContent { &lt;style type="text/css"&gt; .t-widget, .t-widget .t-input, .t-widget .text-box, .t-button { font-family: tahoma; font-size: 100%; } .field-validation-error { position: static; right: 50px; top: -15px; } * html .field-validation-error { position: relative; } *+html .field-validation-error { position: relative; } .field-validation-error span { position: absolute; white-space: nowrap; color: red; padding: 17px 5px 3px; background: transparent url('@Url.Content("~/Content/Common/validation-error-message.png") ') no-repeat 0 0; } /* in-form editing */ .t-edit-form-container { width: 460px; margin: 1em; } .t-edit-form-container .editor-label{ float: right;} .t-edit-form-container .editor-field { padding-bottom: 1em; float: right; } .t-edit-form-container .editor-label { width: 30%; text-align: right; padding-right: 3%; clear: right; } .t-edit-form-container .editor-field { width: 60%; font: } #GridPopUp { position:fixed; top:10px; } &lt;/style&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload