How to select ribbonTab1 when i selected radPageViewPage1

5 posts, 2 answers
  1. Anoop
    Anoop avatar
    18 posts
    Member since:
    Dec 2012

    Posted 03 Jan 2013 Link to this post

    I  had a radPageview have 3 pages radPageViewPage1,radPageViewPage2 & radPageViewPage3
    I had also a radRibbonbar having tabs ribbonTab1,ribbonTab2 & ribbonTab3
    i want to select ribbonTab1 when i selected  radPageViewPage1 and so on
    How to do this? 
  2. Answer
    Plamen
    Admin
    Plamen avatar
    132 posts

    Posted 08 Jan 2013 Link to this post

    Hi Anoop,

    Thank you for writing.

    In order to achieve the desired scenario, you can use the SelecterPageChanged event of the PageView. The event is raised when currently selected page has changed. See the code snippet:
    void radPageView1_SelectedPageChanged(object sender, EventArgs e)
    {
        radRibbonBar1.RibbonBarElement.TabStripElement.SelectedItem = (RibbonTab)radRibbonBar1.CommandTabs[radPageView1.Pages.IndexOf(radPageView1.SelectedPage)];
    }

    I hope this helps.

    Kind 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
  4. Lord
    Lord avatar
    4 posts
    Member since:
    Feb 2013

    Posted 21 Feb 2013 Link to this post

    Hi, I don't know if this is the correct post to write this, but it is a very similar question :)

    I need to do almost the same thing, but I want to enable/disable CommandBarStripElement1 when I select/deselect RadPageViewPage1

    Can you post an answer in VB please?

    Thanks a lot
  5. Answer
    Lord
    Lord avatar
    4 posts
    Member since:
    Feb 2013

    Posted 21 Feb 2013 Link to this post

    An answer to myself  :D

    Private Sub RadPageView1_SelectedPageChanged(sender As System.Object, e As System.EventArgs) Handles RadPageView1.SelectedPageChanged
        Select Case RadPageView1.Pages.IndexOf(RadPageView1.SelectedPage)
            Case 0
                CommandBarStripElement1.Enabled = True
            Case Else
                CommandBarStripElement1.Enabled = False
        End Select
    End Sub

    Regards
    Lord Quo
  6. Plamen
    Admin
    Plamen avatar
    132 posts

    Posted 26 Feb 2013 Link to this post

    Hi Lord,

    Thank you for sharing your solution with the community.

    I can confirm that this is a valid approach and this is why I am marking your post as Answer as wel.

    Off topic it is better to separate the threads that are not related to each other in different threads, as this makes them easy discoverable when needed. Please refer to p.4 from our forum guidelines: http://www.telerik.com/community/forums/winforms/gridview/important-information-on-using-the-telerik-forums.aspx.

    Do not hesitate to contact us if you have further questions.

    Kind regards,
    Plamen
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Back to Top
UI for WinForms is Visual Studio 2017 Ready