How to get ReadOnly property of the text box ?

May 10, 2009 at 9:34 AM

Dear All,

 

I’ve a text box. I’m able to get whether this text box is enabled or not.

 

But not able to get the ReadOnly property of the text box.

 

Is there any way to get that ?

 

If so please let me know . . . Thank You !

 

Thanks & Regards,

Kannan

May 12, 2009 at 12:15 PM

Dear All,

 

I fixed this issue by writing the following property in the TextBox class,

 

        public virtual bool ReadOnly

        {

            get

            {

                return ((ValuePattern)Pattern(ValuePattern.Pattern)).Current.IsReadOnly;

            }

        }

 

Hope this may helps somebody !

 

Thanks & Regards,

Kannan