New item in maximized size

8 posts, 0 answers
  1. Radek
    Radek avatar
    7 posts
    Member since:
    Apr 2011

    Posted 18 Apr 2011 Link to this post

    Helo,
    I have a problem with the correct rendering of items when I need new added itmes.
    When I add new tileViewItem is everything alright. But I want to be the last tileViewItem added to the maximum size.
    In this case are next minimized items (in my case, every third) displayed wrong. 
    When I resize the window, items are rendered correctly.

    In XAML I have
                <telerik:RadTileView x:Name="myTileView" MinimizedColumnWidth="200">
                </telerik:RadTileView>
    In .cs file


            private void Button_Click(object sender, RoutedEventArgs e) {

                RadTileViewItem tileItem = new RadTileViewItem();
              
                RadFluidContentControl contentControl = new RadFluidContentControl();
                contentControl.SmallContent = "Small content - demo";
                contentControl.Content = "Content - demo";
                contentControl.LargeContent = "Content - large";
                contentControl.State = FluidContentControlState.Large;

                tileItem.Content = contentControl;

       //tileItem.TileState = TileViewItemState.Maximized;

                myTileView.Items.Add(tileItem);
            }

    Thanks for help.
    Radek Bastinec
  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 19 Apr 2011 Link to this post

    Hi Radek,

     Thank you for the bug report. We'll look into this problem and I hope that it'll be fixed in the next couple of weeks. For now I can give you a work around - if you want the just added item to be maximized you should use the MaximizedItem property of the RadTileView like this:

    private void Button_Click(object sender, RoutedEventArgs e)
    {
         RadTileViewItem tileItem = new RadTileViewItem();
               
         RadFluidContentControl contentControl = new RadFluidContentControl();
         contentControl.SmallContent = "Small content - demo";
         contentControl.Content = "Content - demo";
         contentControl.LargeContent = "Content - large";
         contentControl.State = FluidContentControlState.Large;
     
         tileItem.Content = contentControl;
     
         this.myTileView.Items.Add(tileItem);
         this.myTileView.MaximizedItem = tileItem;
    }
    I updated your telerik account and if you have further 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
  3. DevCraft banner
  4. Vladislav
    Admin
    Vladislav avatar
    276 posts

    Posted 18 May 2011 Link to this post

    Hi Radek,

    We want to inform you, that this issue is already fixed.
    You can check it in our next internal build. It should be released in the beginning of the next week.
    Any feedback/comments on the subject (once the internal build is available) are highly appreciated.

    Kind regards,
    Vladislav
    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
  5. Radek
    Radek avatar
    7 posts
    Member since:
    Apr 2011

    Posted 20 May 2011 Link to this post

    Hello,

    Thank you, all works fine !

  6. Josef
    Josef avatar
    10 posts
    Member since:
    Oct 2010

    Posted 06 Oct 2011 Link to this post

    Hi Vladislav, after 6 mounts we've similar problem. We previously used mehod onButtonClick
    a now we use MVVM. We need to be newly added item to appear as maximized.

    Here is XAML code.

    <cc:TileView Name="tvAdmin" MinimizedColumnWidth="200" ItemsSource="{Binding Workspaces}"></cc:TileView>


    <Style TargetType="cc:TileView">
        <Setter Property="PreservePositionWhenMaximized" Value="True" />
        <Setter Property="telerik:TileViewPanel.IsVirtualized" Value="True" />
        <Setter Property="TileStateChangeTrigger" Value="SingleClick" />
        <Setter Property="RowHeight" Value="160" />
        <Setter Property="ColumnWidth" Value="180" />
        <Setter Property="ItemTemplate" Value="{StaticResource CloseAbleViewItemTemplate}" />
    </Style>

    And code in 
    namespace WPF.Library.Controls{
        public class TileView : Telerik.Windows.Controls.RadTileView  {
     
            static TileView () {
                // DefaultStyleKeyProperty.OverrideMetadata(....));
            }
     
            public TileView (){
                this.MaximizeMode = TileViewMaximizeMode.One;
            }
     
            protected override void OnItemsChanged (NotifyCollectionChangedEventArgs e) {
                base.OnItemsChanged(e);
     
                if (e.Action == NotifyCollectionChangedAction.Add) {
                    if (e.NewStartingIndex > 0){
                        SelectedItem = Items[e.NewStartingIndex];    
                        this.MaximizedItem = SelectedItem;
                    }
                }
                return;
            }
        }
    }

    In this solution is a new item appears as a maximized but disappear all previous items. If I close
     this item with other items displayed correctly.

    Can you please suggest a correct solution.
    Thank you Radek Bastinec.


  7. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 11 Oct 2011 Link to this post

    Hello Josef,
    Thank you for the feedback! There seems to be a problem in your scenario so I logged it in our PITS under the name "In binding scenarios if you set a newly added item to be maximized you get wrong layout". For now there's a workaround that you can use - you can override the PrepareContainerForOverride and in it set the TileState of the new item to Maximized.
    I've updated your telerik account and for further information please examine the attached project.

    Kind regards,
    Zarko
    the Telerik team

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

  8. Josef
    Josef avatar
    10 posts
    Member since:
    Oct 2010

    Posted 11 Oct 2011 Link to this post

    Thank You Zanko for your example.
    Now it works great.

    Josef

  9. Vladislav
    Admin
    Vladislav avatar
    276 posts

    Posted 29 Feb 2012 Link to this post

    Hi Josef,

    We want to inform you that this issue is fixed in our latest official 2012 Q1 release.
    It will be great if you can give it a try and let us know if it works for you.

    On a separate note, I'd like to let you know that there are 5 brand new controls that we included in this release:
    - Diagrams (Beta)
    - GanttView (CTP)
    - TimeLine
    - ListBox (Beta)
    - DataBar
    When you have time, you can give them a try as we will highly appreciate your feedback.


    Greetings,
    Vladislav
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top
DevCraft banner