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

Manually set focus and scroll to a Task

Thread ID:





119725 Jul 24,2015 03:30 PM UTC Jul 28,2015 04:14 PM UTC ASP.NET Web Forms 3
Tags: Gantt
Asked On July 24, 2015 03:30 PM UTC


When the ejGantt is loading, I would like to set the focus and scroll to a particulary Task.
I tried to set the SelectedItem in the DataBound event without success.

Is there a way to perform this ?

Thanks, Rémi.

John Rajaram [Syncfusion]
Replied On July 27, 2015 09:18 AM UTC

Hi Rémi,

Thanks for using Syncfusion Products.

At present there is no built-in support in Gantt to focus specific taskbar item on loading. For this we have already logged a feature request regarding this.

A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.


But currently we can achieve your requirement through workaround at sample level with “Create” client side event, which will focus and scroll the Gantt chart to the today’s taskbar item.

Please refer the following code snippets for more details.

Code snippets:

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">

        <ej:Gantt ID="Gantt" runat="server"





            function create(args) {

                var proxy = this;

                var dt = new Date();

                var startDate = Globalize.parseDate(args.model.scheduleStartDate, this.model.dateFormat);

                var result = Math.round((dt - startDate) / (1000 * 60 * 60 * 24));

                var left = result * 30;

                $("#ganttviewerbodyContianerejGanttChart" + this._id).ejScroller("option", "scrollLeft", left);

                $("#ganttviewerheaderContainerejGanttChart" + this._id).scrollLeft(left);




Please find the sample in the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/119725/ze/SampleFocusTaskbar-1870530348

Please let us know if you have any questions about this.
John R

Replied On July 27, 2015 01:10 PM UTC

Thanks that helped me a lot to achieve my requirement.

A last request, is it possible to programmatically select a row depending on a task ID ?


Mahalakshmi Karthikeyan [Syncfusion]
Replied On July 28, 2015 04:14 PM UTC

Hi Remi,

For your kind information, at present there is no support to update the scroller at load time for the particular task Id. But we can select any row at load time with the help of “SelectedRowIndex” and focus that particular row in the “Create” client side event. Please refer the below code snippet to achieve this.

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">

<ej:Gantt ID="Gantt" runat="server" AllowColumnResize="true" TaskIdMapping="TaskID"






            function create(args) {

                var ganttObj = $("#MainContent_Gantt").data("ejGantt");





We have also prepared sample based on this and you can find the sample under the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/119725/ze/SampleFocusTaskbar-1740726231

We will consider to achieve any row to be focus at the load time in the feature we have already logged.


Mahalakshmi 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

or the page will be automatically redirected to 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