This is a migrated thread and some comments may be shown as answers.

Scrolling to a specific row on the ganttview

3 Answers 141 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 28 Jun 2012, 09:35 PM
Hello,

My ganttview has many rows, and I would like to programactilly show a particular row the first visible row, that is I would like to programactilly scroll to a particular row.  Is this possible in ganttview?

Thanks,
Eric

3 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 29 Jun 2012, 11:46 AM
Hello Eric,

This feature is on our road map and we will add it to the 2012 Q3 version of the GanttView which is expected to be at the end of October. As the feature is not under development yet any suggestions about it will be greatly appreciated.

Hope this time frame is good for you.

Regards,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Eric
Top achievements
Rank 1
answered on 10 Jul 2012, 12:14 AM
Hello,

Unfourtunatly, I will be leaving in August so October is a little far out.  Also unfourtunatly, this is probably my most desired feature for the ganttView.  If you don't understand why, try adding 4000 tasks to a gantt chart, and them locating one of them by name (without removing the other tasks).  It's pretty much impossible.  I found out how to to do half of it.  In ganttview, there is an ItemsPresenter class.  In ItemsPresenter, there is the private SchedulingScrollContentPresenter field which controls the scrolling.  With some nice .net tricks, the scroll bar can be set (see below for code). The other half is, of course, finding the right offet.  Looking at the source, I noticed that there is seperate hiearchy (I think) where from each item one can calculate the number of items above it.  Using that index, I can calculate the veritcal offset for the scrollbar.  Only problem is, I don't know how to correlate the GanttItem to the backend hierarchy item yet.

Finally, I'm planning to post the list of features I'd like for the GanttView sometime later in the summer, but some things that come to mind:
Set the task that is the last one not shown above the ganttview, the first one shown at the top to the ganttview, the one in the middle of the ganttview, the last one shown at the bottom, and the first one not shown at the bottom of the ganttview.
Oh, also scrolling animation would be nice :)

Thanks,
Eric
var ganttItemsPresenter = directoriesGanttView.Template.FindName("ItemsPresenter", directoriesGanttView);
            var ganttItemsPresenterType = ganttItemsPresenter.GetType();
            var fieldInfo = ganttItemsPresenterType.GetField("groupsScrollPresenter", BindingFlags.NonPublic | BindingFlags.Instance);
            Debug.Assert(fieldInfo != null, "SchedulingScrollContentPresenter field type is missing from ganttItemsPresenter");
            var schedulingScrollContentPresenter =
                fieldInfo.GetValue(ganttItemsPresenter) as SchedulingScrollContentPresenter;
            Debug.Assert(schedulingScrollContentPresenter != null, "SchedulingScrollContentPresenter field value is missing from ganttItemsPresenter");
            schedulingScrollContentPresenter.SetVerticalOffset(10000);
0
Miroslav Nedyalkov
Telerik team
answered on 10 Jul 2012, 10:54 AM
Hi Erik,

Thank you for sharing your thoughts. I completely understand in which cases you would need such feature. What I wanted to know was how you would expect it to work - would you like to provide a task, an index, a logical location like "scroll to end" or "scroll to top" and do you expect this to affect the timeline.

Once again thank you for your input - we will try to develop this feature earlier. Any ideas or suggestions for its API and behavior are greatly appreciated.

Kind regards,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GanttView
Asked by
Eric
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Eric
Top achievements
Rank 1
Share this question
or