Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making Text box not editable

Tags:

asp.net

work on C# asp.net vs 05. I have a requirment, I have to fill text box with some data on gridview , which is coming from database and make it read-only

After that user can not enter any text on gridview template field. If I set textbox Enabled=false, then i lose text color, but i want to show text color. Just textbox to not be editable. I just want users to not be able to write anything in my textbox.


1 Answers

Isn't there a readonly property for the text box.

If then you can use

ReadOnly="true"

for the text box.

If you can use a label then I would prefer that one.

For wrapping contents inside a label you can use

word-wrap

word-wrap: break-word

Inside the properties choose your column field and in the properties.

Under Styles section

You can give a CssClass to the column.

If you specify CssClass as 'TextStyle'

the css looks like this

.TextStyle
{
    color: #a9a9a9
}

In the color attribute give either the color name like 'red' or the hexcode like '#000000' for the text.

like image 129
rahul Avatar answered Jun 07 '26 10:06

rahul