[bug report] order proplem when binding to position property

5 posts, 0 answers
  1. Alex Fan
    Alex Fan avatar
    39 posts
    Member since:
    Jul 2009

    Posted 01 Jun 2011 Link to this post

    Hi I am using 2011.1.419 version.

    Bugs i found:
    1, the position property is not behaving correctly. I am expecting the order of items will be 1-7 (even some of them are hidden), but it is not.
    2, if you remove binding to Position property and hardcode all items' position from 1 - 7 (or 0 - 6), application will blew up.
    3, if you remove binding and use following code in RadTileView, you will find one tile (t6) is missing
    <telerik:RadTileViewItem Header="t1" Visibility="Collapsed"/>
    <telerik:RadTileViewItem Header="t2" Visibility="Visible"/>
    <telerik:RadTileViewItem Header="t3" Visibility="Collapsed"/>
    <telerik:RadTileViewItem Header="t4" Visibility="Visible"/>
    <telerik:RadTileViewItem Header="t5" Visibility="Collapsed"/>
    <telerik:RadTileViewItem Header="t6" Visibility="Visible"/>
    <telerik:RadTileViewItem Header="t7" Visibility="Collapsed"/>


    Please run this code
    xaml:
    <UserControl
        x:Class="SilverlightApp.RadTileView.RadTileViewInTabControl"
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400">
          
        <UserControl.Resources>
            <DataTemplate x:Key="itemTemplate">
                <telerik:RadTileView MinimizedColumnWidth="120" 
                                     PreservePositionWhenMaximized="True" 
                                     DataContext="{Binding Path=Value}">
                    <telerik:RadTileViewItem Header="t1" Position="{Binding Path=Position1, Mode=TwoWay}" Visibility="Visible"/>
                    <telerik:RadTileViewItem Header="t2" Position="{Binding Path=Position2, Mode=TwoWay}" Visibility="Visible"/>
                    <telerik:RadTileViewItem Header="t3" Position="{Binding Path=Position3, Mode=TwoWay}" Visibility="Collapsed"/>
                    <telerik:RadTileViewItem Header="t4" Position="{Binding Path=Position4, Mode=TwoWay}" Visibility="Visible"/>
                    <telerik:RadTileViewItem Header="t5" Position="{Binding Path=Position5, Mode=TwoWay}" Visibility="Collapsed"/>
                    <telerik:RadTileViewItem Header="t6" Position="{Binding Path=Position6, Mode=TwoWay}" Visibility="Visible"/>
                    <telerik:RadTileViewItem Header="t7" Position="{Binding Path=Position7, Mode=TwoWay}" Visibility="Collapsed"/>
                </telerik:RadTileView>
            </DataTemplate>
            <DataTemplate x:Key="headerTemplate">
                <ContentPresenter Content="{Binding Path=Key}"/>
            </DataTemplate>
            <Style x:Key="itemStyle" TargetType="telerik:RadTabItem">
                <Setter Property="HeaderTemplate" Value="{StaticResource headerTemplate}"/>
                <Setter Property="ContentTemplate" Value="{StaticResource itemTemplate}"/>
            </Style>
        </UserControl.Resources>
          
        <Grid x:Name="LayoutRoot" Background="White">
            <telerik:RadTabControl ItemsSource="{Binding}" ItemContainerStyle="{StaticResource itemStyle}">
            </telerik:RadTabControl>
        </Grid>
    </UserControl>


    cs:
    using System.Collections.Generic;
    using System.Windows.Controls;
      
    namespace SilverlightApp.RadTileView
    {
        using GalaSoft.MvvmLight;
      
        public partial class RadTileViewInTabControl : UserControl
        {
            public RadTileViewInTabControl()
            {
                InitializeComponent();
                DataContext = new Dictionary<object, object>
                                  {
                                      { "111", new TileViewVm() },
                                      { "222", "content 22" },
                                  };
            }
        }
      
        public class TileViewVm : ViewModelBase
        {
            private int _position1;
            public int Position1
            {
                get { return _position1; }
                set
                {
                    if (_position1 == value)
                    {
                        return;
                    }
                    _position1 = value;
                    RaisePropertyChanged("Position1");
                }
            }
      
            private int _position2;
            public int Position2
            {
                get { return _position2; }
                set
                {
                    if (_position2 == value)
                    {
                        return;
                    }
                    _position2 = value;
                    RaisePropertyChanged("Position2");
                }
            }
      
            private int _position3;
            public int Position3
            {
                get { return _position3; }
                set
                {
                    if (_position3 == value)
                    {
                        return;
                    }
                    _position3 = value;
                    RaisePropertyChanged("Position3");
                }
            }
      
            private int _position4;
            public int Position4
            {
                get { return _position4; }
                set
                {
                    if (_position4 == value)
                    {
                        return;
                    }
                    _position4 = value;
                    RaisePropertyChanged("Position4");
                }
            }
      
            private int _position5;
            public int Position5
            {
                get { return _position5; }
                set
                {
                    if (_position5 == value)
                    {
                        return;
                    }
                    _position5 = value;
                    RaisePropertyChanged("Position5");
                }
            }
      
            private int _position6;
            public int Position6
            {
                get { return _position6; }
                set
                {
                    if (_position6 == value)
                    {
                        return;
                    }
                    _position6 = value;
                    RaisePropertyChanged("Position6");
                }
            }
      
            private int _position7;
            public int Position7
            {
                get { return _position7; }
                set
                {
                    if (_position7 == value)
                    {
                        return;
                    }
                    _position7 = value;
                    RaisePropertyChanged("Position7");
                }
            }
        }
    }
  2. Alex Fan
    Alex Fan avatar
    39 posts
    Member since:
    Jul 2009

    Posted 01 Jun 2011 Link to this post

    and also please please please try this one, surprise for u :)

    <telerik:RadTileViewItem Header="t1" Visibility="Collapsed"/>
    <telerik:RadTileViewItem Header="t2" Visibility="Visible"/>
    <telerik:RadTileViewItem Header="t3" Visibility="Visible"/>
    <telerik:RadTileViewItem Header="t4" Visibility="Visible"/>
    <telerik:RadTileViewItem Header="t5" Visibility="Visible"/>
    <telerik:RadTileViewItem Header="t6" Visibility="Collapsed"/>
    <telerik:RadTileViewItem Header="t7" Visibility="Collapsed"/>
    <telerik:RadTileViewItem Header="t8" Visibility="Visible"/>
    <telerik:RadTileViewItem Header="t9" Visibility="Visible"/>
    <telerik:RadTileViewItem Header="t10" Visibility="Visible"/>
    <telerik:RadTileViewItem Header="t11" Visibility="Collapsed"/>
  3. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 02 Jun 2011 Link to this post

    Hello Alex Fan,
    Thank you for the bug report. We'll look into in and we'll try to fix it for the Q2 2011 Beta. I've also logged it in our PITS under the name " Incorrect layout when you have multiple collapsed items on initial loading" and it will be ready for tracking tomorrow the latest.
    I've updated your telerik account and if you have more questions feel free to ask.

    Regards,
    Zarko
    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
  4. Martin Ennemoser
    Martin Ennemoser avatar
    9 posts
    Member since:
    Sep 2004

    Posted 15 Jul 2011 Link to this post

    This problem just cost me a couple of hours :(

    Any chance we will see a fix or a workaround in the next couple of weeks?
  5. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 18 Jul 2011 Link to this post

    Hello Martin Ennemoser,
    Could you please try the latest dlls from Q2, because this problem should be fixed in them?
    If you have more questions feel free to ask.

    Greetings,
    Zarko
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top