RadTextBoxElement ignores readonly/enabled?

2 posts, 0 answers
  1. Jay
    Jay avatar
    62 posts
    Member since:
    Sep 2005

    Posted 14 Jul 2008 Link to this post

    Not sure if I'm doing this the wrong way, or if there is a bug in the control, but I can't seem to set the enabled or readonly property to disable text entry for a time.  Is there something I'm doing wrong or a workaround?

    I tried
    Element.Enabled = false;
    Element.TextBoxItem.Enabled = false;
    Element.TextBoxItem.ReadOnly = true;
    Element.TextBoxItem.HostedControl.Enabled = false;

    None seemed to work.
  2. Nikolay
    Nikolay avatar
    1802 posts

    Posted 15 Jul 2008 Link to this post

    Hello Jeff Sheldon,

    If you are using the RadTextBox control, you should set the Enabled or ReadOnly properties directly:
    this.radTextBox1.Enabled = false;  
    // or  
    this.radTextBox1.ReadOnly = true

    If you scenario regards RadTextBoxElement , currently, we have an issue with disabling the text entry when setting the Enabled property. However, when you set this.radTextBox1.TextBoxElement.TextBoxItem.ReadOnly = true you should not be able to enter any text. Of course this is only a property for the read-only behavior, so your RadTextBoxElement will still look enabled.

    If you want your RadTextBoxElement to look disabled (and dimmed) with no possibility of entering text, please consider using the following code snippet:
    this.radTextBox1.TextBoxElement.TextBoxItem.HostedControl.Enabled = false

    If you have additional questions, feel free to contact me.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft R3 2016 release webinar banner
Back to Top