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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Editing Columns with Dropdown

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hello!

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)"
headerTemplate="#nameTemplate"
width="100"
editType="dropdownEdit"
edit="@(new { @params = new {
                                                  dataSource = new List<object>() { new { value = "test", text = "test" },new { value = "test2", text = "test2" } },
                                                  fields = new { text = "text", value = "value" }
                                                       } })">
</e-gantt-column>

Please Advise.

Thank you




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

Update:

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-columns> 
        //... 
        <e-gantt-column field="Custom" editType="dropdownedit" 
                        edit="new {@params = DropDownList }"> 
        </e-gantt-column> 
    </e-gantt-columns> 
</ejs-gantt> 
 

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. 

Regards, 
Pooja Priya K. 


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

Hi!

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

Lukas

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. 

Regards, 
Pooja K. 


CONFIRMATION

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