ScrollTo help please

2 posts, 0 answers
  1. Steve Austin
    Steve Austin avatar
    7 posts
    Member since:
    Jan 2010

    Posted 21 Feb 2013 Link to this post

    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 ?
  2. Plamen
    Admin
    Plamen avatar
    132 posts

    Posted 26 Feb 2013 Link to this post

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