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
public
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.Orientation.Horizontal;
radRibbonBarButtonGroup1.MinSize = new System.Drawing.Size(22, 22);
radRibbonBarButtonGroup1.ShowBorder = true;
// create the labels
RadLabelElement 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 = RadAutoSizeMode.WrapAroundChildren;
tbSizeHeight = new RadTextBoxElement();
tbSizeHeight.MinSize = new Size(100, 0);
tbSizeHeight.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
// add the controls to the button group
radRibbonBarButtonGroup1.Items.AddRange(new RadItem[] { radLabelElement1, tbSizeWidth, radLabelElement2, tbSizeHeight });
// add the group to the chunk
m_chkPositionAndSize.Items.Add(radRibbonBarButtonGroup1);
// add the chunks to the control
this.Items.Add(m_chkPositionAndSize);
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?