We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Editing Columns with Dropdown

Thread ID:





149986 Dec 17,2019 08:47 AM UTC Dec 19,2019 04:40 AM UTC ASP.NET Core - EJ 2 4
Tags: Gantt Chart
Lukas Knapp
Asked On December 17, 2019 08:47 AM UTC


I want to be able to edit some columns in my Gantt Chart with a Dropdown.
However, I seem to be unable to find any documentation on how to do that.
I've found a forum post on how to do that with the Grid Control, but that doesn't seem to work for the Gantt Column,
the Dropdown just stays empty if I follow the syntax in the forum post.
If I try different syntax, the Dropdown fills with all the different values that are present in the Gantt Tasks for that specific column.

Here's a condensed Version of one of the things I tried:

<e-gantt-column field="@nameof(TermineModel.Name)"
edit="@(new { @params = new {
                                                  dataSource = new List<object>() { new { value = "test", text = "test" },new { value = "test2", text = "test2" } },
                                                  fields = new { text = "text", value = "value" }
                                                       } })">

Please Advise.

Thank you

Lukas Knapp
Replied On December 17, 2019 01:39 PM UTC


Found out that the method I was using is actually working.... Sort of.
Thing is, the Dropdown only works in the Edit Modal, not when trying to inline-edit in the columns.
I do want inline-editing though, so help is still appreciated.

Pooja Priya Krishna Moorthy [Syncfusion]
Replied On December 18, 2019 08:55 AM UTC

Hi Lukas, 
We can load the custom data in dropdown by using the edit.params property. While setting the data source using edit params, it is necessary to initialize the query property also. 
Please find the below code example. 
    var DropDownList = new Syncfusion.EJ2.DropDowns.DropDownList() { 
        DataSource = new List<object>() { new { value = "test", text = "test" }, new { value = "test2", text = "test2" } }, 
        Query = "new ej.data.Query()", 
        Fields = new Syncfusion.EJ2.DropDowns.DropDownListFieldSettings() { Text = "text", Value = "value" }, 
<ejs-gantt id='Gantt' dataSource="ViewBag.DataSource" > 
        <e-gantt-column field="Custom" editType="dropdownedit" 
                        edit="new {@params = DropDownList }"> 

Please get back to us if you require further assistance on this. 
Note: For security purpose, we have removed bin and obj folder in the shared sample. 

Pooja Priya K. 

Lukas Knapp
Replied On December 18, 2019 09:48 AM UTC


After Setting the Query and explicitly creating instances of DropDownList and DropDownListFieldSettings instead of using anonymous types, it worked.

Thanks for the help!

Kind Regards


Pooja Priya Krishna Moorthy [Syncfusion]
Replied On December 19, 2019 04:40 AM UTC

Hi Lukas, 
We are happy that your issue has been resolved. Please get back to us if you require further assistance on this. 
As always we will be happy to assist you. 

Pooja K. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon