Add Intem in codeBehind

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

    Posted 19 Apr 2011 Link to this post

    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);
    }

  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 19 Apr 2011 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top