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

ScrollTo help please

1 Answer 59 Views
Panorama
This is a migrated thread and some comments may be shown as answers.
Steve Austin
Top achievements
Rank 1
Steve Austin asked on 21 Feb 2013, 10:04 AM
Im trying to scroll to a tile like this...

Me.RadPanorama1.PanoramaElement.ScrollToItem(RadTileElement1)

The above works fine if i have created the 'RadTileElement1' at design time, but how do I get the name of the tile if I have created it dynamically at run-time ?

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 26 Feb 2013, 09:05 AM
Hi Steve,

Thank you for writing.

The tiles in RadPanorama are stored in the Items collection of the control when grouping is not used, and in the Items collection of the groups when such are used. So you can iterate the collections to access the desired tile and scroll to it:
For Each tile As RadTileElement In radPanorama1.Items
    If tile.Text = "News" Then
        radPanorama1.PanoramaElement.ScrollToItem(tile)
    End If
Next
 
'OR
 
For Each tile As RadTileElement In DirectCast(radPanorama1.Groups(0), TileGroupElement).Items
    If tile.Text = "News" Then
        radPanorama1.PanoramaElement.ScrollToItem(tile)
    End If
Next

I hope this helps.


Regards,
Plamen
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
Panorama
Asked by
Steve Austin
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or