Is is possible to zoom only without showing the scrollbar?

4 posts, 0 answers
  1. Pablo
    Pablo avatar
    38 posts
    Member since:
    Oct 2012

    Posted 07 Sep 2011 Link to this post

    Hello,

    Due to the particular needs of our project, we want the user to be able to zoom over the chart's X Axis but without showing any scrollbar. We would do it using the MouseLeftButtonDown and Up belonging to the plot area, calculating the data points and setting a new RangeEnd and RangeStart for the ZoomSettings object. 

    However, right now it is only possible to set ZoomSettings to None, Scroll or ScrollAndZoom. Is there any workaround so that zoom can be made (as described above) but hidding the ScrollBar? If so, could you please provide any code sample?

    Thank you very much, 

    Pablo.

  2. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 09 Sep 2011 Link to this post

    Hello Pablo,

    Please, consider the following approach :
    this.LayoutUpdated += new EventHandler(MainPage_LayoutUpdated);
    bool onlyTheFirstTime = false;
           void MainPage_LayoutUpdated(object sender, EventArgs e)
           {
               if (onlyTheFirstTime)
                   return;
               onlyTheFirstTime = true;
               var axisContainer = this.ChildrenOfType<Telerik.Windows.Controls.Charting.AxisX2D>()                
                   .First();
               foreach (var item in axisContainer.ChildrenOfType<RadSlider>())
                   item.Visibility = System.Windows.Visibility.Collapsed;
           }

    This way the scrollbar should be collapsed, while still keeping the Zoom&Scroll settings and being able to zoom in/out.

    Hope this helps.

    Regards,
    Nikolay
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Pablo
    Pablo avatar
    38 posts
    Member since:
    Oct 2012

    Posted 09 Sep 2011 Link to this post

    Hello Nikolay,

    Thank you for your response. I'll try this implementation and get back to you with any issue. 

    Regards, 

    Pablo.
  5. Pablo
    Pablo avatar
    38 posts
    Member since:
    Oct 2012

    Posted 12 Sep 2011 Link to this post

    Hi Nikolay,

    It worked. Thank you, that's what we needed!

    Regards, 

    Pablo.
Back to Top