- Home
- Forum
- ASP.NET Core - EJ 2
- Multiple dropdownlist in grid with inline editing
Multiple dropdownlist in grid with inline editing
Hello,
I'm continue my proof of concept with you Framework :)
I have an inline edit page based on the grid, and i would integrate a multiple dropdownlist as column in the grid with inline editing.
My models :
Currency (Id, Name, IsoCode) < 0-n >Export (Id, Name)
A "Currency" can be exported on 0 or many "Export".
The grid is for CRUD the Currency model, and the content of the dropdownlist would be based on the Export model.
After searching a moment, i have found sample, but with de EJ version only, and i use the EJ 2.
Thank you for help.
Best regards,
SIGN IN To post a reply.
3 Replies
PS
Pavithra Subramaniyam
Syncfusion Team
September 6, 2019 12:11 PM UTC
Hi Yann,
Greetings from Syncfusion.
Query: Multiple dropdownlist in grid with inline editing
We have validated your query and we are quite unclear about your requirement. Could you please check the below documentation links and check whether the below topics satisfy your requirement or not.
Help documentation: https://ej2.syncfusion.com/aspnetcore/documentation/grid/how-to/#provide-custom-data-source-and-enabling-filtering-to-dropdownlist
If the above links does not meet your requirement, then could you please share the below details. It will be help to provide a better solution.
- Do you want to render multi select dropdown list in grid column?
- Share the link for EJ1 sample if possible.
- Share more details about your requirement.
Regards,
Pavithra S
YJ
Yann Jobin
September 9, 2019 11:03 AM UTC
Hi,
For answer to you questions :
- Do you want to render multi select dropdown list in grid column? Yes ! But with the content of the dropdownlist must be data from another table with Relationship !
- Share the link for EJ1 sample if possible. This the link : https://www.syncfusion.com/forums/141189/multi-select-dropdownlist-in-grid
- Share more details about your requirement. Render multi select dropdown in grid column, with the ASP.NET Core EJ2 Framework.
Thank you for support.
Best regards
PS
Pavithra Subramaniyam
Syncfusion Team
September 10, 2019 07:16 AM UTC
Hi Yann,
Thanks for your update.
Based on your requirement we have created a sample in which, we have rendered multiselect dropdown in CustomerID column(while editing) by using cell edit template support. Please find the below code example and sample for your reference.
[code example]
|
<ejs-grid id="Grid" dataSource="@ViewBag.data" allowPaging="true" toolbar="@( new List<object>() {"Add","Edit","Delete","Update","Cancel"})">
...
<e-grid-columns>
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="120"></e-grid-column>
<e-grid-column field="CustomerID" headerText="Customer ID" textAlign="Right" width="120" edit="@(new {create = "onCreate", read = "onRead", write = "onWrite", destroy= "onDestroy"})"></e-grid-column>
...
</e-grid-columns>
</ejs-grid>
<script>
var multiSelectEle;
var element
function onCreate(args) {
element = document.createElement('input');
return element;
}
function onRead(e) {
return multiSelectEle.value;
}
function onDestroy() {
multiSelectEle.destroy();
}
function onWrite(args) {
multiSelectEle = new ej.dropdowns.MultiSelect({ //rendering multiSelectEle component
dataSource: @Html.Raw(Json.Serialize(@ViewBag.dropData)),
fields: { value: "CustomerID", text:"CustomerID"}
});
multiSelectEle.appendTo(element);
}
</script> |
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/EJ2GridCoreMultiSelect1801745335
Help Documentation: https://ej2.syncfusion.com/aspnetcore/documentation/grid/edit/#cell-edit-template
Please get back to us if you need further assistance.
Regards,
Pavithra S.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
YJ Yann Jobin
- Aug 29, 2019 11:28 AM UTC
- Sep 10, 2019 07:16 AM UTC