[Solved] Ribbon default tab

1 Answer 5 Views
RibbonBar RichTextEditor
Kevin
Top achievements
Rank 1
Kevin asked on 05 May 2026, 11:47 AM

I have a RichTextEditRibbonBar and RadRichTextEditor, linked together. I'm using this as an email compose window, so I hid most of the tabs, just keeping Home, Insert, and Page Layout. After doing so though, the ribbon defaults to showing the Page Layout tab. I added some code on the form load event to select the Home tab, but if I select a table in the email, bringng up the Table Tools context ribbon, when I leave the table (click somewhere else in the editor) it jumps to Page Layout again. 

Any suggestions, as its quite annoying. Designer code below:


        ctlMenu.AssociatedRichTextEditor = txtMessage
        ctlMenu.Location = New System.Drawing.Point(0, 0)
        ctlMenu.Name = "ctlMenu"
        ctlMenu.Size = New System.Drawing.Size(1028, 176)
        InboxControlStyler.SetStyleSettings(ctlMenu, New Infragistics.Win.AppStyling.Runtime.InboxControlStyleSettings(Infragistics.Win.DefaultableBoolean.Default))
        ctlMenu.TabIndex = 0
        ctlMenu.TabStop = False
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(3), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Text = "References"
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(3), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Visibility = Telerik.WinControls.ElementVisibility.Collapsed
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(3), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Name = "tabReferences"
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(4), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Text = "Mailings"
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(4), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Visibility = Telerik.WinControls.ElementVisibility.Collapsed
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(4), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Name = "tabMailings"
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(5), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Text = "Review"
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(5), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Visibility = Telerik.WinControls.ElementVisibility.Collapsed
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(5), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Name = "tabReview"
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(6), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Text = "View"
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(6), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Visibility = Telerik.WinControls.ElementVisibility.Collapsed
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(6), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Name = "tabView"
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(7), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Text = "Developer"
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(7), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Visibility = Telerik.WinControls.ElementVisibility.Collapsed
        CType(ctlMenu.GetChildAt(0).GetChildAt(4).GetChildAt(0).GetChildAt(0).GetChildAt(7), Telerik.WinControls.UI.RichTextEditorRibbonUI.RichTextEditorRibbonTab).Name = "tabDeveloper"

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 05 May 2026, 08:38 PM

Hi Kevin,

Thank you for reaching out to us and for the provided details.

I observed the described behavior. Basically, after clicking outside of the Table, the last tab will be selected. You can workaround this by checking if the cursor is currently on a Table. If not, select the first tab. You can subscribe to the CurrentEditingStyleChanged event.

AddHandler Me.radRichTextEditor1.CurrentEditingStyleChanged, AddressOf RadRichTextEditor1_CurrentEditingStyleChanged

Private Sub RadRichTextEditor1_CurrentEditingStyleChanged(sender As Object, e As EventArgs)
    Dim table = radRichTextEditor1.Document.CaretPosition.GetCurrentTable()
    If table Is Nothing Then
        richTextEditorRibbonBar1.RibbonBarElement.TabStripElement.SelectedItem = TryCast(Me.richTextEditorRibbonBar1.CommandTabs(0), RibbonTab)
    End If
End Sub

I hope that this approach wil work for you.

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
RibbonBar RichTextEditor
Asked by
Kevin
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or