Hi,
I have a control which inherits from RadTextBox
The layout should be the following, (a textbox with a button on its side and a couple of labels)
___________________________________________________ |
| TextElement TextElement | |
|__________________________________________________| |
|_TextBox ________________________________|_Button_| |
Problem is I cannot get the textbox and button to lay out in the correct order. The button is always rendered to the left and the textbox to the right, any way to change this?
Thanks,
/ jorge
protected override void CreateChildItems(RadElement parent) |
{ |
base.InitializeTextElement(); |
title.Text = "Title"; |
title.Class = "Title"; |
validation.Text = "* Validation failed"; |
validation.Visibility = ElementVisibility.Collapsed; |
validation.Class = "Validation"; |
validation.ForeColor = Color.Red; |
AcceptsTab = false; |
TabStop = true; |
textBoxElement.Size = new Size(402, 20); |
button.Image = global::revival.Properties.Resources.file_16; |
button.ImageAlignment = System.Drawing.ContentAlignment.MiddleCenter; |
button.TabIndex = 0; |
button.Dock = DockStyle.Right; |
button.ButtonElement.StretchHorizontally = false; |
button.ButtonElement.StretchVertically = false; |
button.ButtonElement.Margin = new Padding(4, 0, 0, 0); |
button.ButtonElement.Padding = new Padding(1); |
BoxLayout layoutTexts = new BoxLayout(); |
layoutTexts.Orientation = Orientation.Horizontal; |
layoutTexts.StretchVertically = false; |
layoutTexts.Children.Add(title); |
layoutTexts.Children.Add(validation); |
BoxLayout layoutEditor = new BoxLayout(); |
layoutEditor.Orientation = Orientation.Horizontal; |
layoutEditor.StretchVertically = false; |
// how do i get the textbox to render to the left and the button to the right? |
layoutEditor.Children.Add(textBoxElement); |
layoutEditor.Children.Add(button.ButtonElement); |
BoxLayout layout = new BoxLayout(); |
layout.Orientation = Orientation.Vertical; |
layout.Children.Add(layoutTexts); |
layout.Children.Add(layoutEditor); |
RootElement.Children.Add(layout); |
Size = new Size(425, 34); |
} |