This is a migrated thread and some comments may be shown as answers.

New item in maximized size

7 Answers 102 Views
TileView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Radek
Top achievements
Rank 1
Radek asked on 18 Apr 2011, 03:01 PM
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

7 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 19 Apr 2011, 03:49 PM
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
0
Vladislav
Telerik team
answered on 18 May 2011, 01:30 PM
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
0
Radek
Top achievements
Rank 1
answered on 20 May 2011, 01:23 PM

Hello,

Thank you, all works fine !

0
Josef
Top achievements
Rank 1
answered on 06 Oct 2011, 01:05 PM
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.


0
Zarko
Telerik team
answered on 11 Oct 2011, 09:00 AM
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 >>

0
Josef
Top achievements
Rank 1
answered on 11 Oct 2011, 09:26 AM
Thank You Zanko for your example.
Now it works great.

Josef

0
Vladislav
Telerik team
answered on 29 Feb 2012, 03:44 PM
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 >>
Tags
TileView
Asked by
Radek
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Vladislav
Telerik team
Radek
Top achievements
Rank 1
Josef
Top achievements
Rank 1
Share this question
or