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

combobox textbox not aligning correctly

2 Answers 1862 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Lily
Top achievements
Rank 1
Veteran
Lily asked on 03 Jul 2020, 03:53 PM

Hi,

I have an issue where I had originally set the combobox textbox alignment to the right with:

// **** Align Drop Down Box Text to Right
revPurgeCodeDropList.MultiColumnComboBoxElement.TextBoxElement.TextAlign = HorizontalAlignment.Right;
addPurgeCodeDropList.MultiColumnComboBoxElement.TextBoxElement.TextAlign = HorizontalAlignment.Right;
scrapCodeDropList.MultiColumnComboBoxElement.TextBoxElement.TextAlign = HorizontalAlignment.Right;
scrapRsnDropList.MultiColumnComboBoxElement.TextBoxElement.TextAlign = HorizontalAlignment.Right;
// ************************

And it worked correctly.  But then I decided I didn't want the user to be able to input anything, only select from drop down.  So I added raddropdownstyle.dropdownlist:

// **** not allow use to type in
scrapCodeDropList.DropDownStyle = RadDropDownStyle.DropDownList;
scrapRsnDropList.DropDownStyle = RadDropDownStyle.DropDownList;
revPurgeCodeDropList.DropDownStyle = RadDropDownStyle.DropDownList;
addPurgeCodeDropList.DropDownStyle = RadDropDownStyle.DropDownList;
// ************************

The raddropdownstyle.dropdownlist worked, but the alignment isn't working any longer.  I tried to put this before and I tried after before it's the same. Am I doing something wrong? Here's what I have now:

// **** not allow use to type in
scrapCodeDropList.DropDownStyle = RadDropDownStyle.DropDownList;
scrapRsnDropList.DropDownStyle = RadDropDownStyle.DropDownList;
revPurgeCodeDropList.DropDownStyle = RadDropDownStyle.DropDownList;
addPurgeCodeDropList.DropDownStyle = RadDropDownStyle.DropDownList;
// ************************
 
// **** Align Drop Down Box Text to Right
revPurgeCodeDropList.MultiColumnComboBoxElement.TextBoxElement.TextAlign = HorizontalAlignment.Right;
addPurgeCodeDropList.MultiColumnComboBoxElement.TextBoxElement.TextAlign = HorizontalAlignment.Right;
scrapCodeDropList.MultiColumnComboBoxElement.TextBoxElement.TextAlign = HorizontalAlignment.Right;
scrapRsnDropList.MultiColumnComboBoxElement.TextBoxElement.TextAlign = HorizontalAlignment.Right;
// ************************

2 Answers, 1 is accepted

Sort by
0
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 07 Jul 2020, 11:58 AM

Hello, Lily,

In order to align the text that is shown in the text box area when RadMultiColumnComboBox is in RadDropDownStyle.DropDownList you should set the TextAlignment property of the TextboxContentElement as shown below:

this.radMultiColumnComboBox1.DropDownStyle = RadDropDownStyle.DropDownList;
this.radMultiColumnComboBox1.MultiColumnComboBoxElement.TextboxContentElement.TextAlignment = ContentAlignment.MiddleRight;

Do not hesitate to contact me if you have other questions.

Regards,
Nadya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Lily
Top achievements
Rank 1
Veteran
answered on 20 Jul 2020, 02:23 AM
Thank you so much!
Tags
MultiColumn ComboBox
Asked by
Lily
Top achievements
Rank 1
Veteran
Answers by
Nadya | Tech Support Engineer
Telerik team
Lily
Top achievements
Rank 1
Veteran
Share this question
or