Problem when using 'ScrollMode'

4 posts, 0 answers
  1. Kibeom
    Kibeom avatar
    2 posts
    Member since:
    Apr 2011

    Posted 08 Jun 2011 Link to this post


    I've implemeted a chart. It is everythings OK when using ScrollMode-None. But it has problem when using ScrollMode-ScrollOnly or ScrollAndZoom mode. Textbox or any controls are lost focus when using ScrollMode-'ScrollOnly or ScrollAndZoom'.

    <UserControl x:Class="CGS.UX.PlotDisplay.Example"
        Loaded="UserControl_Loaded" Unloaded="UserControl_Unloaded">

            <example:ExampleViewModel />

                <RowDefinition Height="100"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
            <TextBox Grid.Row="0" Width="100"></TextBox>
            <Border Grid.Row="1" >
                <telerik:RadChart x:Name="rdChart" ItemsSource="{Binding Data}">
                                <telerik:ChartArea LegendName="ChartLegend1"
                                                   NoDataString="Waiting for data..."
                                        <telerik:ZoomScrollSettings ScrollMode="ScrollAndZoom"></telerik:ZoomScrollSettings>
                                            <telerik:AxisX DefaultLabelFormat="#VAL{hh:mm:ss}" LabelStep="2"
                                                       LayoutMode="Normal" Title="Time" AutoRange="False"
                                                       MinValue="{Binding AxisXMinValue}"
                                                       MaxValue="{Binding AxisXMaxValue}"
                                                       Step="{Binding AxisXStep}"
                                        <telerik:AxisY DefaultLabelFormat="#VAL" Title="CPU Utilization in %"
                                                       AutoRange="True"  />
                                <telerik:ChartLegend x:Name="ChartLegend1" />
                                <telerik:ChartTitle Content="Server Load" />

    using System;
    using System.Collections.Generic;
    using System.Windows.Controls;
    using System.Windows.Threading;
    using Telerik.Windows.Controls.Charting;
    using System.Collections.ObjectModel;
    using Telerik.Windows.Controls;
    using System.Windows;

    namespace CGS.UX.PlotDisplay
        /// <summary>
        /// Interaction logic for Example.xaml
        /// </summary>
        public partial class Example : UserControl
            private int             _collectionIdx = 0;
            public Example()


                List<string> mnemonics = new List<string>();

                mnemonics.Add( "AAA" );
                mnemonics.Add( "BBB" );

                SetUpSeriesMapping( mnemonics );


            public void SetupMnemonic( List<string> mnemonics )


            private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
                (this.DataContext as ExampleViewModel).StartTimer();

            private void UserControl_Unloaded(object sender, System.Windows.RoutedEventArgs e)
                (this.DataContext as ExampleViewModel).StopTimer();

            private void SetUpSeriesMapping(List<String> mnemonics)
                foreach (string mnemonic in mnemonics)
                    (this.DataContext as ExampleViewModel).TmData.Add( new ObservableCollection<TMData>() );
                    //Series mapping for the collection with index 0
                    SeriesMapping seriesMapping = new SeriesMapping();
                    seriesMapping.CollectionIndex = _collectionIdx;
                    seriesMapping.LegendLabel = mnemonic;
                    seriesMapping.SeriesDefinition = new LineSeriesDefinition();
                    seriesMapping.SeriesDefinition.ShowItemLabels = false;
                    (seriesMapping.SeriesDefinition as LineSeriesDefinition).ShowPointMarks = false;

                    //seriesMapping.SeriesDefinition.EmptyPointBehavior = EmptyPointBehavior.Gap;

                    ItemMapping itemMapping;

                    itemMapping = new ItemMapping();
                    itemMapping.DataPointMember = DataPointMember.XValue;
                    itemMapping.FieldName = "Time";

                    itemMapping = new ItemMapping();
                    itemMapping.DataPointMember = DataPointMember.YValue;
                    itemMapping.FieldName = "EU";




  2. Evgenia
    Evgenia avatar
    1437 posts

    Posted 13 Jun 2011 Link to this post

    Hi Kibeom,

    If you want  your TextBox to be focused when the Chart is Loaded you can add the following code line after the InitializeComponent constructor:

    Dispatcher.BeginInvoke(() => { txtBox.Focus();});

    For more information about the Dispatcher's methods take a look at this msdn topic.

    Best wishes,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Shlomi
    Shlomi avatar
    1 posts
    Member since:
    Jul 2011

    Posted 07 Dec 2011 Link to this post


    We are in the middle of an evaluation of your WPF controls.

    I'm having the same problem when using ZoomScrollSettings in my charts.
    When I'm updating the data on the chart, the chart takes the focus. If I have an open window, it looses focus every chart update !

    I tested it on your examples:"RadControls for WPF Q3 2011 Demos" in the project "Live Data"
     (in folder ~\Telerik\RadControls for WPF Q3 2011\Demos\Examples\Chart\LiveData)

    I've added only these following lines to the xaml (in your demo):

      <telerik:ChartArea.ZoomScrollSettingsX >
                        <telerik:ZoomScrollSettings x:Name="zoomSettings" ScrollMode="ScrollAndZoom" MinZoomRange="0.005" />                </telerik:ChartArea.ZoomScrollSettingsX>

    Now, if I have a button that opens a window and the zoom ScrollMode is not set to "None", every data update the chart takes focus.

    We need an answer ASAP.


  4. Giuseppe
    Giuseppe avatar
    2363 posts

    Posted 09 Dec 2011 Link to this post

    Hi Shlomi,

    As mentioned in the support ticket you have opened on the same topic this is a bug and we can suggest you as a temporary workaround to handle the RadChart.Loaded event like this:

    private void RadChart1_Loaded(object sender, RoutedEventArgs e)
                this.RadChart1.ChildrenOfType<RadSlider>().FirstOrDefault().Focusable = false;

    Best wishes,
    the Telerik team

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

Back to Top