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);
}
Radek Bastinec
7 Answers, 1 is accepted
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;
}
Zarko
the Telerik team
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
Hello,
Thank you, all works fine !
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.
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 >>
Now it works great.
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