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

Text wrap in MultiColumnComboBox

2 Answers 230 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Roberto Wenzel
Top achievements
Rank 2
Roberto Wenzel asked on 17 Mar 2011, 07:06 PM
Hello,
is ist possible to get long text wrapped in a MultiColumnComboBox column?
Haven't found a clue so far.
Thank you in advance.
Best regards
Roberto

2 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 17 Mar 2011, 09:23 PM
Hi Roberto,

Yes, you can do this by getting to the RadGridView via the EditorControl, and then setting AutoSizeRows to true and the column to WrapText

For exmaple

class Person
public class Person
{
    public Person(string name, int id, string desc)
    { this.Name = name; this.Id = id; this.Desc = desc; }
    public string Name
    { get; set; }
    public int Id
    { get; set; }
    public string Desc
    { get; set; }
}

In Form Load for exmaple
List<Person> people = new List<Person>();
for (int i = 0; i <= 101; i++)
{
    people.Add(new Person("Name " + i, i, "Some quite long description that goes in here"));
}
this.radMultiColumnComboBox1.DataSource = people;
this.radMultiColumnComboBox1.DisplayMember = "Name";
this.radMultiColumnComboBox1.ValueMember = "Id";
this.radMultiColumnComboBox1.MultiColumnComboBoxElement.DropDownSizingMode = Telerik.WinControls.UI.SizingMode.UpDownAndRightBottom;
this.radMultiColumnComboBox1.MultiColumnComboBoxElement.DropDownMinSize = new Size(300, 0);
this.radMultiColumnComboBox1.EditorControl.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
this.radMultiColumnComboBox1.EditorControl.AutoSizeRows = true;
this.radMultiColumnComboBox1.EditorControl.Columns["Desc"].WrapText = true;

hope that helps, but let me know if you need more information
Richard
0
Roberto Wenzel
Top achievements
Rank 2
answered on 18 Mar 2011, 09:15 AM
Thank you again Richard.
Your solution works fine.
Cheers Roberto
Tags
MultiColumn ComboBox
Asked by
Roberto Wenzel
Top achievements
Rank 2
Answers by
Richard Slade
Top achievements
Rank 2
Roberto Wenzel
Top achievements
Rank 2
Share this question
or