Scrolling to a specific row on the ganttview

4 posts, 1 answers
  1. Eric
    Eric avatar
    48 posts
    Member since:
    Jul 2012

    Posted 28 Jun 2012 Link to this post

    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
  2. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 29 Jun 2012 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Eric
    Eric avatar
    48 posts
    Member since:
    Jul 2012

    Posted 09 Jul 2012 Link to this post

    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);
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 10 Jul 2012 Link to this post

    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 >>

Back to Top