Selection/Scroll behavior

7 posts, 0 answers
  1. Richard
    Richard avatar
    10 posts
    Member since:
    Sep 2014

    Posted 19 Nov 2014 Link to this post

    Hello,

    when i select a row on gridside the ganttarea is scrolling to the related ganttbar (startdate).
    Is there a possibility to deactivate this behavior?

    Greetings,
    Richard

  2. Polya
    Admin
    Polya avatar
    200 posts

    Posted 20 Nov 2014 Link to this post

    Hello Richard,

    Currently we do not allow modifications in the scrolling settings.
    The only thing I can suggest is returning the scroll into the previously selected GanttTask, when the RadGanttView selection changes.
    I have created a sample project demonstrating this approach. In the attached sample project in RadGanttView.SelectionChanged event I call RadGanttView.ScrollingService.ScrollIntoView(previous_GanttTask). This way we move the view back to the previously selected GanttTask and it appears we have not moved at all. You can insert your custom logic to disable the scrolling in the RadGanttView.SelectionChanged event.

    I've logged this feature request in our Feedback Portal where you can track its status and vote to raise its priority.

    Regards,
    Polya
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Richard
    Richard avatar
    10 posts
    Member since:
    Sep 2014

    Posted 24 Nov 2014 in reply to Polya Link to this post

    Hello Polya,

    thank you for your sample but it dosn't work for me.
    Gantt is scrolling to each selected item (wich is not completly in the visible area) like before.
    Please can you check the sample?

    Regards,
    Richard
  5. Polya
    Admin
    Polya avatar
    200 posts

    Posted 26 Nov 2014 Link to this post

    Hello Richard,

    The sample project I sent is not fully implemented - I left the check when to scroll to the previous item to be implemented by you.
    If, however the desired scenario is to disable scrolling on selection whatsoever I can suggest a better solution:
    Internally the RadGanttView contains 3 ScrollBars - 2 horizontal ( for the GridView part and for the TimeRuler part ) and 1 vertical.
    1) We can get these ScrollBars using the RadGanttView.ChildrenOfType<ScrollBar>() method.
    2) Also we can handle the ScrollBar.Scroll event that is called only when the user scrolls using the thumb and store the Value of the TimeRuler horizontal ScrollBar.
    3) Then in the RadGanttView_SelectionChanged event handler we can scroll the TimeRuler ScrollBar to the stored value from step 2.

    This way visually it would appear as if no scroll is performed whatsoever.
    Please find attached the modified project using this approach.

    Hopefully this helps and is suitable for your scenario.


    Regards,
    Polya
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Richard
    Richard avatar
    10 posts
    Member since:
    Sep 2014

    Posted 27 Nov 2014 in reply to Polya Link to this post

    Hello Polya,

    thank you for your tip. Now i can set the value of the horizontal scrollbar,
    but i don't find the Scrollbar.Scroll Event i.e. to store the value when user is
    scrolling through scrollbar.

    Regards,
    Richard

    //???
    private void Scroll_Changed(object sender, ScrollBar e)
    {
        var memo = e.Value;
    }
     
    private void gantt_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        var gantt = sender as RadGanttView;
     
        var scrBars = gantt.ChildrenOfType<ScrollBar>().ToArray();
        if (scrBars.Length == 3)
        {
            var timeRulerAreaScrollbar = scrBars[1];
            System.Diagnostics.Debug.WriteLine(timeRulerAreaScrollbar.Value.ToString());
            timeRulerAreaScrollbar.Value = 0; // <= set to memo
        }
    }


  7. Richard
    Richard avatar
    10 posts
    Member since:
    Sep 2014

    Posted 28 Nov 2014 in reply to Richard Link to this post

    Hello Polya,

    i find it. Thank you for your help.

    Regards,
    Richard
  8. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 28 Nov 2014 Link to this post

    Hello Richard,

    We are glad you have managed to achieve the desired. If you have any other questions or concerns, please let us know.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready