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

RadTextBoxElement ignores readonly/enabled?

1 Answer 152 Views
Toolstrip (obsolete as of Q3 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jay
Top achievements
Rank 1
Jay asked on 14 Jul 2008, 01:10 PM
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.

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 15 Jul 2008, 11:38 AM
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,
Nikolay
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Toolstrip (obsolete as of Q3 2010)
Asked by
Jay
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or