SparkLine ghost on resize

2 posts, 0 answers
  1. Alexey Oyun
    Alexey Oyun avatar
    74 posts
    Member since:
    Mar 2010

    Posted 22 Nov 2010 Link to this post

    Hi,

    Problem:

      1. Assign collection to sparkline
      2. Assign null to sparkline
      3. Resize sparkline

    Result:
      Sparkline will show its state before assigning null to it.

    Expected:
      Sparkline should be empty.

      XAML:
    Grid x:Name="LayoutRoot">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid x:Name="_column" SizeChanged="_column_SizeChanged">
                <Controls:RadLinearSparkline x:Name="_Spark" ShowMarkers="True" Height="100" Width="100" />
            </Grid>
            <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="45,12,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" Grid.Column="1" />
            <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="45,41,0,0" Name="button2" VerticalAlignment="Top" Width="75" Click="button2_Click" Grid.Column="1" />
            <sdk:GridSplitter Name="gridSplitter1" VerticalAlignment="Stretch" HorizontalAlignment="Right" VerticalContentAlignment="Stretch" />
        </Grid>

    C#:
    public partial class MainPage : UserControl
        {
            public class dataXY
            {
                public dataXY(double x, double y) { X = x; Y = y; }
                public double X { get; set; }
                public double Y { get; set; }
            }
            private ObservableCollection<dataXY> _data = new ObservableCollection<dataXY>();
            public MainPage()
            {
                InitializeComponent();
                _Spark.XValuePath = "X";
                _Spark.YValuePath = "Y";
                Binding bind = new Binding();
                bind.Source = _data;
                bind.Mode = BindingMode.OneWay;
                _Spark.ItemsSource = _data;
            }
     
            private void button1_Click(object sender, RoutedEventArgs e)
            {
                _data.Add(new dataXY(1, 0));
                _data.Add(new dataXY(2, 1));
                _data.Add(new dataXY(10, 2));
                _data.Add(new dataXY(11, 3));
                _data.Add(new dataXY(12, 2));
                _data.Add(new dataXY(20, 1));
            }
     
            private void button2_Click(object sender, RoutedEventArgs e)
            {
                _Spark.ItemsSource = null;
            }
     
            private void _column_SizeChanged(object sender, SizeChangedEventArgs e)
            {
                _Spark.Width = _column.ActualWidth;
            }
        }


    Sincerely, Alexey.
  2. Evgeni "Zammy" Petrov
    Admin
    Evgeni "Zammy" Petrov avatar
    168 posts

    Posted 24 Nov 2010 Link to this post

    Hi Alexey Oyun,

     Thank you for pointing out this problem. We are working on it.
    Here is a link to PITS issue: 
    http://www.telerik.com/support/pits.aspx#/public/silverlight/4100

    All the best,
    Evgeni "Zammy" Petrov
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
Back to Top