TextBoxElement on QuickAccessbar on RadRibbonForm

4 posts, 0 answers
  1. Holger
    Holger avatar
    33 posts
    Member since:
    Jan 2015

    Posted 03 Apr 2018 Link to this post

         I'm wondered why the design-Time Editor of QuickAccessToolbarItems of RadRibbonForm is not offering to add a TextBoxElement,

    However, I added it programmaticly.

    this.radRibbonBar1.QuickAccessToolBarItems.Add(new Telerik.WinControls.UI.RadTextBoxElement());

    it appears, bot I cannot focus and type in it (The CanFocus property is set to true).

     

    Maybe some RadItem Types, are not offered by purpose in the Designer ?

    I thought, putting a search text element in the QuickAccessToolbar is a quiet common scheme.

    Is there a way to get a fully functional TextBoxElement into a QuickAccessToolbar ?

  2. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 04 Apr 2018 Link to this post

    Hello Holger,

    Thank you for writing. 

    Your approach adding the text box element is generally correct. With this element, however, you should also set the AllowAero property of the form to false. This way you will use our title bar instead of the default one and have the textbox properly painted. It is also necessary to set its MinSize property: 
    public partial class RadRibbonForm1 : Telerik.WinControls.UI.RadRibbonForm
    {
        public RadRibbonForm1()
        {
            InitializeComponent();
     
            this.AllowAero = false;
     
            RadTextBoxElement textBoxElement = new RadTextBoxElement();
            textBoxElement.MinSize = new Size(100, 0);
            textBoxElement.Text = "textBoxElement";
            this.radRibbonBar1.QuickAccessToolBarItems.Add(textBoxElement);
        }
    }

    I am also attaching a screenshot showing the result on my end.

    I hope this helps. Let me know if you need further assistance.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Holger
    Holger avatar
    33 posts
    Member since:
    Jan 2015

    Posted 04 Apr 2018 in reply to Hristo Link to this post

    Yes, thanks, it worked immediatly. And it was painted correctly before, it just couldnt get the Focus.
    I would had never found this AllowAero Property myself.


    Is there a reason, why the possible choices of RadItems, addable by the VS-Designer is so limited ?
    Or is it just a selection of the most common items ?

    Or the items, that are compatible with Aero On or Off ?

  4. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 05 Apr 2018 Link to this post

    Hi Holger,

    Thank you for the update. I am glad that the suggested approach is working well in your actual project.

    Regarding the QuickAccessToolbar we have decided to add only the items which are most commonly used. The standard title bar is working with native APIs and adding a text box to it will not render well unless the AllowAero property is set false. Setting the property to false will disable the standard title bar and we will paint our own which is built on top of TPF. With our title bar, the text box element will paint correctly. I will also update the documentation article here, to include an example how a text box can be added to it.

    I hope this information is useful. Let me know if you need further assistance.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top