RadPanorama Add Group/Tile dynamically

7 posts, 0 answers
  1. David
    David avatar
    1 posts
    Member since:
    Jul 2014

    Posted 25 Feb 2015 Link to this post

    Hi,

    I am trying to create three TileGroupElements and add them to the range of the Panorama. After I am adding the tiles to each group, but the groups nor the tiles are showing on the screen. Please let me know any ways I could do this through code.
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 02 Mar 2015 Link to this post

    Hi David,

    Thank you for the question.

    In order to show groups and its content its very important to set Panorama's ShowGroup to true:
    radPanorama1.ShowGroups = true

    And after that you can populate the Groups and its items:
    this.radPanorama1.ShowGroups = true; 
    Telerik.WinControls.UI.TileGroupElement tileGroupElement1 = new Telerik.WinControls.UI.TileGroupElement();
    Telerik.WinControls.UI.RadTileElement radTileElement1 = new Telerik.WinControls.UI.RadTileElement();
    this.tileGroupElement1.Text = "group";
    this.radTileElement1.Text = "tile";
    this.radPanorama1.Groups.Add(this.tileGroupElement1);
    this.tileGroupElement1.Items.Add(this.radTileElement1);

    I hope this helps.

    Regards,
    Peter
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. baskar
    baskar avatar
    4 posts
    Member since:
    May 2011

    Posted 17 Sep 2015 in reply to Peter Link to this post

    Hi , 

    i want to add a multiple of TileGroupElement as  dynamically, in that each TileGroupElement have a RadTileElement which is also dynamically vary depends on my Data, So How to Add a dynamic TileGroupElement and Dynamic RadTileElement in windows controls?

     

    Thanks 

  5. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 17 Sep 2015 Link to this post

    Hello Baskar,

    Here is a small sample demonstrating how to use the RadPanorama API to add groups and tiles:
    this.radPanorama1.ShowGroups = true;
     
     TileGroupElement tileGroupElement = new TileGroupElement();
     tileGroupElement.Text = "Group 1";
     this.radPanorama1.Groups.Add(tileGroupElement);
     tileGroupElement.RowsCount = 3;
     
     TileGroupElement tileGroupElement1 = new TileGroupElement();
     tileGroupElement1.Text = "Group 2";
     tileGroupElement1.RowsCount = 3;
     this.radPanorama1.Groups.Add(tileGroupElement1);
     
     TileGroupElement tileGroupElement2 = new TileGroupElement();
     tileGroupElement2.Text = "Group 3";
     tileGroupElement2.RowsCount = 3;
     this.radPanorama1.Groups.Add(tileGroupElement2);
     
     for (int i = 0; i < 40; i++)
     {
         RadTileElement radTileElement = new RadTileElement();
         radTileElement.Text = string.Concat("Text ", i);
         //    radTileElement.Row = i % 3;
         ((TileGroupElement)this.radPanorama1.Groups[i % 3]).Items.Add(radTileElement);
     }

    I hope that you find this information useful.

    Regards,
    Stefan
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  6. baskar
    baskar avatar
    4 posts
    Member since:
    May 2011

    Posted 18 Sep 2015 in reply to Stefan Link to this post

    Thanks for your reply, its working ,

    1. I add a RadLiveTileElement in TileGroupElement its contain click Event as codebehind, in RadLiveElement click not firing ? can you give me the sample? , 

     

    my code is 

     

    for (int j = 0; j < 5; j++)
                    {
                        LightVisualElement myitem = new LightVisualElement();
                        myitem.Text = dt.Rows[i]["equipment_name"].ToString() + " - " + j.ToString();
                        
                        tile.Items.Add(new LightVisualElement()
                        {
                            Text = dt.Rows[i]["equipment_name"].ToString()+ " - "+j.ToString(),
                                NumberOfColors = 1,
                                Shape= new RoundRectShape(12)
                        });
                    }

                   
                    tile.AnimationFrames = 50;
                    tile.AnimationInterval = 100;
                    tile.ContentChangeInterval = 4000;
                    tile.TransitionType = ContentTransitionType.SlideUp;

     tile.Click += tile_Click;​

    }

  7. baskar
    baskar avatar
    4 posts
    Member since:
    May 2011

    Posted 18 Sep 2015 Link to this post

    How to add multiple row of text in RadTileElement(panorama) with each row have unique click event?
  8. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 21 Sep 2015 Link to this post

    Hi Baskar,

    Before getting to your questions, may I please ask you to separate the unrelated questions in separate threads. We are trying to keep one subject per topic, so the answers are easy to find.

    As to the Click event not being raised, you will have to set the following properties to your LightVisualElement so the mouse is passed to the tile element:
    tile.Items.Add(new LightVisualElement()
    {
        Text = "something" + " - " + j.ToString(),
        NumberOfColors = 1,
        Shape = new RoundRectShape(12),
        NotifyParentOnMouseInput = true,
        ShouldHandleMouseInput=false
    });

    In order to have multiple rows, you can create a custom tile with LightVisualElements. To arrange them, you can use one of the predefined layouts we offer. To handle the click of the elements, you can expose them as properties to the tile, and subscribe to each element's Click event.

    I hope this helps.

    Regards,
    Stefan
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready