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

Add Intem in codeBehind

1 Answer 39 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Radek
Top achievements
Rank 1
Radek asked on 19 Apr 2011, 03:04 PM
Hello, I need make this.

Add RadTileViewItem if I click on Button. This works good, but I need to bring the latest item has been maximized.

1. I added this code
tileItem.TileState = TileViewItemState.Maximized;

If I add a fourth item, so  the bottom minimized item is wrong size. 
I need to resize the window and the items will be drawn correctly.

2. I added this code
if (tvAdmin.Items.Count > 0) {
                foreach (RadTileViewItem tileItemIn in tvAdmin.Items) {
                    tileItemIn.TileState = TileViewItemState.Minimized;
                }
        }

Minimized items appear all wrong.
I need to resize the window and the items will be drawn correctly.

How should I proceed correctly.

private void Button_Click(object sender, RoutedEventArgs e) {
 
    /*
    if (tvAdmin.Items.Count > 0) {
        foreach (RadTileViewItem tileItemIn in tvAdmin.Items) {
            tileItemIn.TileState = TileViewItemState.Minimized;
        }
    } */
 
    RadTileViewItem tileItem = new RadTileViewItem();
     
    RadFluidContentControl contentControl = new RadFluidContentControl();
 
    contentControl.SmallContent = "Small content";
    contentControl.Content = "Content";
    contentControl.LargeContent = "Large content ";
    contentControl.State = FluidContentControlState.Large;
    contentControl.NormalToLargeThreshold = new Size(300, 400);
    contentControl.NormalToSmallThreshold = new Size(300, 200);
     
    tileItem.Content = contentControl;
   // tileItem.TileState = TileViewItemState.Maximized;
    tileItem.Header = tvAdmin.Items.Count.ToString();
    tvAdmin.Items.Add(tileItem);
}

1 Answer, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 19 Apr 2011, 03:55 PM
Hello Radek,

 We just answered on your question here.
If you need further assistance feel free to ask.

Greetings,
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
Tags
TileView
Asked by
Radek
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Share this question
or