Hi,
Greetings
from Syncfusion Support.
We
have reviewed your query and understand that you would like to assign a custom
dataSource to the DropDownList during editing. We noticed that you have already
provided the dataSource and fields configuration within the column.edit
property. In addition to this, we recommend binding the query property
as well with new Query().
Please
ensure that the value and text fields defined in the fields configuration
exactly match the corresponding key names in the provided dataSource. For your
reference, we have included the corrected code snippet:
|
<e-grid-column
field="Mobil"
headerText="Mobil"
width="220"
editType="dropdownedit"
foreignKeyField="MobilId"
foreignKeyValue="Description"
validationRules="@(new { required = true })"
edit="@(new {
@params = new {
dataSource =
(List<Mobil>)ViewData["lstMobil"],
fields = new { value = "MobilId", text
= "Description" },
placeholder = "Pilih Mobil"
query= new ej.data.Query()
}
})">
|
We
have also discussed this scenario in detail in our documentation regarding how
to provide a custom dataSource for the edit DropDownList. You can refer to the
link below:
Documentation:
https://ej2.syncfusion.com/aspnetcore/documentation/grid/editing/edit-types#provide-custom-data-source-for-dropdownlist-component
Please
get back to us for further assistance.
Regards,
Dineshnarasimman
M