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

How to select ribbonTab1 when i selected radPageViewPage1

4 Answers 76 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Anoop
Top achievements
Rank 1
Anoop asked on 03 Jan 2013, 09:20 PM
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? 

4 Answers, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 08 Jan 2013, 09:32 AM
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.
0
Lord
Top achievements
Rank 1
answered on 21 Feb 2013, 03:08 PM
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
0
Accepted
Lord
Top achievements
Rank 1
answered on 21 Feb 2013, 03:29 PM
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
0
Plamen
Telerik team
answered on 26 Feb 2013, 09:53 AM
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.
Tags
PageView
Asked by
Anoop
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Lord
Top achievements
Rank 1
Share this question
or