This is a migrated thread and some comments may be shown as answers.
How to set ReadOnly to MultiColumn ComboBox
2 Answers 38 Views
This is a migrated thread and some comments may be shown as answers.
Zan
Top achievements
Rank 1
Zan asked on 13 Nov 2017, 04:59 AM

Hello Telerik Team,

I want all MultiColumn ComboBoxes in a form ReadOnly mode

foreach (Control ctrl in this.Controls)
{
  if (ctrl.GetType() == typeof(RadMultiColumnComboBox))
     ((RadMultiColumnComboBox)ctrl).ReadOnly = true//like that
}

However, ReadOnly property does not exist.

How can I set  MultiColumn ComboBox to ReadOnly ?

2 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 13 Nov 2017, 10:28 AM
Hello,

RadMultiColumnComboBox currently does not have a read-only mode. To achieve it you should cancel the row changing by using the CurrentRowChanging event. In addition, you need to set the DropDownStyle to DropDownList:
public RadForm1()
{
    InitializeComponent();
 
    radMultiColumnComboBox1.EditorControl.CurrentRowChanging += EditorControl_CurrentRowChanging;
    radMultiColumnComboBox1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
 
}
 
private void EditorControl_CurrentRowChanging(object sender, Telerik.WinControls.UI.CurrentRowChangingEventArgs e)
{
    e.Cancel = true;
}

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Zan
Top achievements
Rank 1
answered on 13 Nov 2017, 11:41 AM
Thanks Dimitar, your solution working correctly.
Asked by
Zan
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Zan
Top achievements
Rank 1
Share this question
or