RadHostItem does'nt work in my ribbonBarGroup

4 posts, 0 answers
  1. Llorens Mathieu
    Llorens Mathieu avatar
    19 posts
    Member since:
    Jan 2009

    Posted 09 Oct 2009 Link to this post

    I want to add some winform controls in my ribbonbargroup using the RadHostItem. I follow some tips found on this forum but they don't work for me. My ribbonBarGroup is empty

    Here is my code :

    Dim Foo As New TextBox 
    Foo.Text = "Bar" 
    Dim hostItem As New RadHostItem(toto) 
    MyRibbonBarGroup.Items.Add(hostItem) 

    So, I though that the proble came from the add method. I tried the same code replacing the hostItem by a RadButtonElement control and it worked fine.

    That's why I think the problem comes from the radHostItem.
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 09 Oct 2009 Link to this post

    Hello Llorens Mathieu,

    Thank you for writing. You can set manually the minimum size of RadHost Item. For example:

    Dim Foo As New TextBox
    Foo.Text = "Bar"
    Foo.MinimumSize = new Size(100,20);
    Dim hostItem As New RadHostItem(toto)
    toto.MinSize = new Size(100,20);
    MyRibbonBarGroup.Items.Add(hostItem)

    I hope this helps.

    Sincerely yours,
    Peter
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Llorens Mathieu
    Llorens Mathieu avatar
    19 posts
    Member since:
    Jan 2009

    Posted 19 Oct 2009 Link to this post

    Thank you for reply, but I have this result :


    The groupBar does'nt resize itself. Any idea?

    Thanks
  5. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 19 Oct 2009 Link to this post

    Hi Llorens Mathieu,

    I confirm the issue. I suggest using RadTextBoxElement instead of the standard text box in HostItem. Please refer to the code snippet:

    Dim Foo As New Telerik.WinControls.UI.RadTextBoxElement
    Foo.Text = "Bar"
    Foo.MinSize = New Size(200, 20)
    MyRibbonBarGroup.Items.Add(Foo)

    Hope this helps. Do not hesitate to write me back if you have further questions.

    Greetings,
    Peter
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top