Adding radlabel as a banner in between RadRibbonForm title and tab strip

1 Answer 63 Views
ApplicationMenu RibbonBar RibbonForm
Suresh
Top achievements
Rank 1
Suresh asked on 31 May 2024, 02:19 PM

Hi ,

We are using RadRibbonBar in our application and have a requirement to add a custom banner(RadLabel) in between the RadRibbonBar title and the Tab strip as per the attached mockup screen shot. 

 

 

Tried some approaches to achieve this , but it was not successful. Can you please let us know how we can achieve this requirement?.

 

Thanks.

 

Suresh
Top achievements
Rank 1
commented on 04 Jun 2024, 04:26 AM

Hi,

Can any one please respond the query asked?

 

Thanks.

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 05 Jun 2024, 01:33 PM

Hello, Suresh,

Yes, it is possible to achieve such banner in RadRibbonBar. I created an example for your reference. I used two LightVisualElements, added them into a stack element, and then add the stack into the header's children. Please refer to the following code snippet:

public RadForm1()
{
    InitializeComponent(); new RadControlSpyForm().Show();
    this.Text = "Application Manager";

    LightVisualElement lve = new LightVisualElement();
    lve.Text = "You are running this program in offline mode. Your product access will expire in 30 days";
    lve.StretchVertically = true;

    LightVisualElement lve2 = new LightVisualElement();
    lve2.Text = "Details";
    lve2.Font = new Font("Segoe UI", 9f, FontStyle.Underline);
    lve2.ForeColor = Color.Blue;
    lve2.StretchVertically = true;
    lve2.Click += this.Lve2_Click;

    var stackElement = new StackLayoutElementLite();
    stackElement.Padding = new Padding(6);
    stackElement.StretchHorizontally = true;
    stackElement.Children.Add(lve);
    stackElement.Children.Add(lve2);
    stackElement.DrawFill = true;
    stackElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
    stackElement.BackColor = Color.LightYellow;
    stackElement.DrawBorder = true;
    stackElement.BorderGradientStyle = Telerik.WinControls.GradientStyles.Solid;
    stackElement.BorderColor = Color.Orange;

    this.radRibbonBar1.ShowExpandButton = false;
    var tabStrip = this.radRibbonBar1.RibbonBarElement.TabStripElement;
    tabStrip.Header.Visibility = Telerik.WinControls.ElementVisibility.Visible;
    tabStrip.Header.DrawText = false;
    tabStrip.Header.Children.Add(stackElement);
    tabStrip.PropertyChanged += this.TabStrip_PropertyChanged;
}
private void Lve2_Click(object sender, EventArgs e)
{
    // TODO:
}

private void TabStrip_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
    if (e.PropertyName == "Bounds")
    {
        RibbonTabStripElement tabStrip = this.radRibbonBar1.RibbonBarElement.TabStripElement;
        RadApplicationMenuButtonElement appBtn = this.radRibbonBar1.RibbonBarElement.ApplicationButtonElement;
        appBtn.Margin = new Padding(0, (int)tabStrip.Header.DesiredSize.Height, 0, 0);
    }
}

Off topic, I would like to note that threads are handled according to license and time of posting, so if you expect a faster reply by a support representative, you can submit a support ticket, which would be handled before a forum thread.

I hope this helps. If you have any other questions, please let me know.

Regards,
Nadya | 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.

Suresh
Top achievements
Rank 1
commented on 07 Jun 2024, 11:33 AM

Thanks for the reply Nadya. We will check and get back to you incase of any further assistance. 
Tags
ApplicationMenu RibbonBar RibbonForm
Asked by
Suresh
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or