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

RadPanorama Add Group/Tile dynamically

6 Answers 257 Views
Panorama
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 25 Feb 2015, 04:39 PM
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.

6 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 02 Mar 2015, 08:59 AM
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.

 
0
baskar
Top achievements
Rank 1
answered on 17 Sep 2015, 01:43 PM

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 

0
Stefan
Telerik team
answered on 17 Sep 2015, 03:51 PM
Hello ,

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
0
baskar
Top achievements
Rank 1
answered on 18 Sep 2015, 01:26 PM

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;​

}

0
baskar
Top achievements
Rank 1
answered on 18 Sep 2015, 01:40 PM
How to add multiple row of text in RadTileElement(panorama) with each row have unique click event?
0
Stefan
Telerik team
answered on 21 Sep 2015, 10:02 AM
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 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
Tags
Panorama
Asked by
David
Top achievements
Rank 1
Answers by
Peter
Telerik team
baskar
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or