Note that there are some explanatory texts on larger screens.

plurals
  1. POKendo adds instead of editing a DropdownList item
    primarykey
    data
    text
    <p>I use Kendo grid inline editing mode and after editing I need to refresh datasource for my DropDownList.</p> <p>The reason is my KendoGrid is supposed to add and edit data that my DropDownList uses. I have no problem on editing data on KendoGrid and with the help of the code below I refresh the data on the DropDownList.</p> <pre><code>var dropDownList = $("#Domains").data("kendoDropDownList"); dropDownList.dataSource.read(); </code></pre> <p><code>#Domains</code> is the ID of my DropDownList</p> <p>Everything work just fine even if I edit the data that is already selected on the DropDownList . But the problem comes after adding new item in the KendoGrid (Inline Mode) and editing one of the older items which is selected on the DropDownList at the same time.</p> <p>In this situation Kendo doesn't edit the item but It Adds edited item as a new item to the data source and we will have the old item and the edited one as two separate items. I don't know if I convey the situation correctly.</p> <p>I use MVC and the way I define datasource is like this:</p> <pre><code>.DataSource(dataSource =&gt; dataSource .Ajax() .Events(events =&gt; { events.Error("result_handler"); }) .Model(model =&gt; model.Id(p =&gt; p.Id)) .Create(create =&gt; create.Action("AddDomain", "Service", new { customerID = ViewBag.CustomerId })) .Read(read =&gt; read.Action("GetDomainListForGrid", "Service", new { customerID = ViewBag.CustomerId })) .Update(update =&gt; update.Action("EditDomain", "Service")) .Destroy(destroy =&gt; destroy.Action("DeleteDomain", "Service")) ) </code></pre> <p>As you see I set model.Id like the above.</p>
    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.
 

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