This is a migrated thread and some comments may be shown as answers.

TextBox problem

3 Answers 82 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
zagy asked on 16 Dec 2007, 07:51 AM

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?

3 Answers, 1 is accepted

Sort by
Telerik team
answered on 17 Dec 2007, 09:27 AM
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:
RadRibbonBarButtonGroup buttonGroup = new RadRibbonBarButtonGroup(); 
buttonGroup.Items.Add(new RadButtonElement("btn")); 
RadTextBoxElement textBox = new RadTextBoxElement(); 
textBox.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren; 
textBox.MinSize = new Size(40, 16); 
textBox.MaxSize = new Size(60, 20); 

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
Top achievements
Rank 1
answered on 20 Dec 2007, 10:55 AM
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?
Vassil Petev
Telerik team
answered on 20 Dec 2007, 11:46 AM
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
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Top achievements
Rank 1
Vassil Petev
Telerik team
Share this question