Title of PageView (in Explorerbar Mode)

7 posts, 1 answers
  1. DenisCL
    DenisCL avatar
    69 posts
    Member since:
    Dec 2009

    Posted 09 Nov 2010 Link to this post

    Hello,

    I would like to interrupt an auto behavior of the RadPageView in ExplorerBar mode.
    Actually, the title is set as soon as on TabPage is selected, and take this tabpage text.

    Is there any way to set this text myself?

    Thanks for help

    Best regards

  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Nov 2010 Link to this post

    Hi DenisCL, 

    I'm a little unsure as to what you mean. Are you trying to get the text of the selected page in ExplorerBar mode? 
    Please let me know more details and I'll do my best to help
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. DenisCL
    DenisCL avatar
    69 posts
    Member since:
    Dec 2009

    Posted 09 Nov 2010 Link to this post

    Hello,

    Sorry for these explainations.
    In fact when I select a Page in my PageView, the title of Pageview is automatically set with the page .text.

    I simply would like to interrupt this auto set title and set it myself.

    On the attached image, when 1 is selected, 2 is automatically set.

    Thanks for help
  5. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Nov 2010 Link to this post

    Hello,

    Please consider the following code that shows the route to get to the label element in the page view in explorer mode.
    Let me know if you need further help
    Richard

    Private Sub RadPageView1_SelectedPageChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadPageView1.SelectedPageChanged
        Dim explorer As RadPageViewExplorerBarElement = TryCast(Me.RadPageView1.RootElement.Children(0), RadPageViewExplorerBarElement)
        If explorer IsNot Nothing Then
            Dim label As RadPageViewLabelElement = TryCast(explorer.Children(1), RadPageViewLabelElement)
            If label IsNot Nothing Then
                label.Text = "My Page Name"
            End If
        End If
    End Sub
  6. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Nov 2010 Link to this post

    You can also set the initial value (for example in PageLoad) as follows:

    DirectCast(Me.RadPageView1.RootElement.Children(0).Children(1), RadPageViewLabelElement).Text = "My Page Name"

    Richard
  7. DenisCL
    DenisCL avatar
    69 posts
    Member since:
    Dec 2009

    Posted 09 Nov 2010 Link to this post

    Hello Richard.

    Thanks for your help.
    I can now set the title as I wish.

    Everything is fine now.

    Best regards
  8. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Nov 2010 Link to this post

    Glad that worked for you.
    Please remember to mark as answer so other can find the solution too.

    All the best
    richard
Back to Top
UI for WinForms is Visual Studio 2017 Ready