Read Only for all editors

34 posts, 5 answers
  1. Mikkel
    Mikkel avatar
    58 posts
    Member since:
    Oct 2010

    Posted 19 Aug 2012 Link to this post

    I have to agree with Christian that the best solution would be if you added the functionality to your controls.

    Inheriting your controls and writing code as described previously in this thread is not desirable if you want to maintain a bug-free application.

    I would have to test all Telerik controls in my App whenever I update the Telerik components, to ensure that you guys haven't changed anything vital in your controls, and that my App continues to work as intended.

    IMHO it really is NOT an option to start messing with inheriting your controls to achieve a simple feature as a readonly property.

    It makes no sense to me that eg. a RadCheckBox does not display its checked state, just because the control is not Enabled...!? In my opinion that is a bug, also considering that the standard CheckBox controls does show its checked state correctly when not Enabled.

    In fact it makes no sense that any control would not show its value correctly, when not Enabled.

    Since the purpose of using Telerik controls in stead of default controls is to have more features and functionality, I would expect precisely that - not restrictions in functionality.
  2. Stefan
    Stefan avatar
    2906 posts

    Posted 22 Aug 2012 Link to this post


    Thank you for your feedback regarding this matter. There is a feature request added for this functionality. Feel free to add your vote for it here:

    In regards to the check box this is also a known limitation and a case for it also exists:

    Inheriting a control does not mean that a bug will be introduced. Especially in cases like this one. If you have any doubts regarding some functionality, you can always open a support ticket with your control and ask for advice.

    I agree that the check box issue is quite unpleasant. Unfortunately the issue is deep in our framework and addressing it is not an easy task. In regards to the read only state for a drop down list, such feature differs from the control semantic. However, due to the interest shown in this thread, a feature request is created. 

    Feel free to add your votes for those cases since this increases their priority among the other tasks. 

    I hope that you find this reply useful. 
    All the best,
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. Francois
    Francois avatar
    52 posts
    Member since:
    Dec 2010

    Posted 30 Aug 2013 Link to this post

    Sorry to revive an old thread, but for the RadDropdownList, I'm currently using this code and it seems to work well without subscribing to any event :

    /// <summary>
    /// Note : The value of 'SelectNextOnDoubleClick' is set to 'False' in all cases.
    /// </summary>
    /// <param name="ddl"></param>
    /// <param name="readOnly"></param>
    public static void SetReadOnly(this RadDropDownList ddl, bool readOnly)
        ddl.DropDownListElement.ArrowButton.Enabled = !readOnly; // Helps the user identify that the control is ReadOnly
        ddl.SelectNextOnDoubleClick = false;
        ddl.Popup.Enabled = !readOnly;
        // For this mode, prevent modification with the keyboard
        if (ddl.DropDownStyle == RadDropDownStyle.DropDown)
            ddl.DropDownListElement.TextBox.TextBoxItem.ReadOnly = readOnly;
            ddl.EnableMouseWheel = !readOnly;

    EDIT:  I have added the 'ddl.EnableMouseWheel' line, because you could change the value by scrolling with the mouse wheel, 
  4. Stefan
    Stefan avatar
    2906 posts

    Posted 03 Sep 2013 Link to this post

    Hello Francois,

    Thank you for sharing your code with the community. I am sure someone will benefit from it.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top