TextBox problem

4 posts, 0 answers
  1. zagy
    zagy avatar
    7 posts
    Member since:
    Aug 2007

    Posted 16 Dec 2007 Link to this post


    I'm having a lot of problems trying to programatically a TextBox (or RadTextBox or RadTextBoxElement) control to a Button group inside a ribbon chunk).

    Here's what I have:
    My application is a content editor (a bit like Flash but not nearly so advanced). So when I click on an Image:
    1. I want the "Image" context group to appear
    2. I want the the correct properties to appear
    3. When I change the properties in the ribbon - the image has to change

    Because there are several different items and all of them have the same basic functionality I have created:

    // class for handling object operations

    class BaseRibbonObjectHandler : RadRibbonBarCommandTab

    // create the chunk
    m_chkPositionAndSize =

    new RadRibbonBarChunk();
    m_chkPositionAndSize.Orientation = System.Windows.Forms.Orientation.Vertical;
    m_chkPositionAndSize.Text =
    "Position and Size";

    // create the ribbon bar group
    RadRibbonBarButtonGroup radRibbonBarButtonGroup1 = new RadRibbonBarButtonGroup();
    radRibbonBarButtonGroup1.Orientation = System.Windows.Forms.
    radRibbonBarButtonGroup1.MinSize =
    new System.Drawing.Size(22, 22);
    radRibbonBarButtonGroup1.ShowBorder =

    // create the labels
    radLabelElement1 = new RadLabelElement();
    RadLabelElement radLabelElement2 = new RadLabelElement();
    radLabelElement1.Text = "Width ";
    radLabelElement2.Text = "Height ";

    // create the textboxes

    tbSizeWidth =
    new RadTextBoxElement();
    tbSizeWidth.MinSize =
    new Size(100, 0);
    tbSizeWidth.AutoSizeMode =
    tbSizeHeight = new RadTextBoxElement();
    tbSizeHeight.MinSize =
    new Size(100, 0);
    tbSizeHeight.AutoSizeMode =

    // add the controls to the button group
    new RadItem[] { radLabelElement1, tbSizeWidth, radLabelElement2, tbSizeHeight });

    // add the group to the chunk

    // add the chunks to the control

    The idea is that in this class I create the tab page, the basic chunks and the basic items:

    If I add the TextBoxes (it doesn't matter which kind of TextBox - RadTextBox, RadTextBoxElement or WinForms TextBox) the application hangs up (If I wait about a minute I get a stack overflow exception).
    This behavior happens on 3 machines...

    A few more facts:
    - I have another chunk (I didn't copy the code here) with a button and a combobox and it works ok
    - If I add the radTextBoxElement directly to the chunk (and not to a button group) - it works

    Am I doing something wrong? Or is this a bug?
  2. Jordan
    Jordan avatar
    547 posts

    Posted 17 Dec 2007 Link to this post

    Hi zagy,

    Thank you for writing. This is a known issue and we are working on a solution at the moment.
    I cannot give you a precise timeframe at the moment, but it will most probably be available in one of our future releases.

    For now you can workaround this problem by setting both MinSize and MaxSize as shown below:
    1 RadRibbonBarButtonGroup buttonGroup = new RadRibbonBarButtonGroup(); 
    2 buttonGroup.Items.Add(new RadButtonElement("btn")); 
    3 RadTextBoxElement textBox = new RadTextBoxElement(); 
    4 textBox.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren; 
    6 textBox.MinSize = new Size(40, 16); 
    7 textBox.MaxSize = new Size(60, 20); 
    8 buttonGroup.Items.Add(textBox); 
    10 this.radRibbonBarChunk1.Items.Add(buttonGroup); 

    This should allow you to add text boxes in a button group.

    If you have any further questions, please do not hesitate to contact us.

    All the best,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft R3 2016 release webinar banner
  4. zagy
    zagy avatar
    7 posts
    Member since:
    Aug 2007

    Posted 20 Dec 2007 Link to this post

    Great... that solved the problem. Thank you.

    When can we expect Q3? And if I buy the controls now, will I still get the Q3 update?
  5. Vassil Petev
    Vassil Petev avatar
    1765 posts

    Posted 20 Dec 2007 Link to this post

    Hello zagy,

    Q3 was released on Tuesday and you can download it from your account!

    Let me know what you think of the new version.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top