How to set ReadOnly to MultiColumn ComboBox

3 posts, 0 answers
  1. AungKo
    AungKo avatar
    14 posts
    Member since:
    Feb 2017

    Posted 12 Nov Link to this post

    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. Dimitar
    Admin
    Dimitar avatar
    1994 posts

    Posted 13 Nov Link to this post

    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.
  3. AungKo
    AungKo avatar
    14 posts
    Member since:
    Feb 2017

    Posted 13 Nov Link to this post

    Thanks Dimitar, your solution working correctly.
Back to Top