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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Enable and Disable Gantt Toolbar Buttons

Thread ID:

Created:

Updated:

Platform:

Replies:

118064 Jan 27,2015 04:25 PM UTC Jan 29,2015 06:39 AM UTC ASP.NET Web Forms 1
loading
Tags: Gantt
Otto Moura Machado Filho
Asked On January 27, 2015 04:25 PM UTC

Hi,

how can I disable and enable gantt toolbar buttons, based on a combobox selection for example?

Thanks,
Otto Machado.

PS: While sending this message I forgot to select the "Control" on the combobox, I received a message "Please select control" but the message was cleaned, and I had to type again.

John Rajaram [Syncfusion]
Replied On January 29, 2015 06:39 AM UTC

Hi Otto,

Thanks for using Syncfusion products.

Query

Syncfusion Comments

How can I disable and enable gantt toolbar buttons, based on a combobox selection for example?

We can enable or disable Toolbar items in the Gantt control based on the combo box selection.

Please refer the following code snippets for more details.

Code snippets:

@(Html.EJ().Gantt("Gantt").

         

//...

ToolbarSettings(eve =>

       {

           eve.ShowToolbar(true);

           eve.ToolbarItems(new List<GanttToolBarItems>(){

                      GanttToolBarItems.Add,

                      GanttToolBarItems.Edit,

                      GanttToolBarItems.Delete,

                      GanttToolBarItems.Cancel,

                      GanttToolBarItems.Update

           }

       );

       Datasource(ViewBag.dataSource)

    )

@(Html.EJ().ScriptManager())

<script type="text/javascript">

//Function to enable or disable toolbar in combobox selection

        function onDataChange(args) {

            var ganttObject = $("#Gantt").data("ejGantt");

            if (args.itemId == 0) {

                //To enable toolbar in Gantt control

                if (!ganttObject.model.toolbarSettings.showToolbar)

                    ganttObject.model.toolbarSettings.showToolbar = true;

                ganttObject.reRenderChart();

            }

            else if (args.itemId == 1) {

                //To disable toolbar in Gantt control

                if (ganttObject.model.toolbarSettings.showToolbar)

                    ganttObject.model.toolbarSettings.showToolbar = false;

                ganttObject.reRenderChart();

            }

        }

</script>

.

PS: While sending this message I forgot to select the "Control" on the combobox, I received a message "Please select control" but the message was cleaned, and I had to type again.

We were able to reproduce the issue and we have confirmed this as bug and logged a report on this. Also we have created a support incident under your account to track the status of this issue.

Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

 

Please let me know if you have any questions.

We have also prepared a sample based on this. Please find the sample in the following location:

Sample: http://www.syncfusion.com/downloads/support/directtrac/118064/SQLinMVC_Toolbar2031321672.zip

Please let us know if you require further assistance on this.

Regards,
John. R



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.

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

;