Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simplest way to turn FormView into the ReadOnly mode
Message
From
05/06/2008 16:21:19
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01321954
Message ID:
01321973
Views:
22
>>>Hi everybody,
>>>
>>>Just wondering what is the simplest way to turn the FormView with EditItemTemplate into the ReadOnly mode? I tried Enabled = 'false', but having everything (including labels) disabled doesn't look good.
>>>
>>>Any other ideas?
>>>
>>>My Form uses UserControls, so the alternative method would be to disable controls inside UserControls, but I'm looking for a simpler solution.
>>>
>>>Thanks in advance.
>>
>>We just disable "Save" functionality for the page.
>
>I removed the Undo/Save buttons, but I want to make texboxes, comboboxes to be ReadOnly.

But if the user can't save, aren't all user inputs readonly? The only other way would be to iterate over all controls and set databound controls to readonly.

PS, your user controls should have public properties for things like ReadOnly. The user control can then manipulate its contained controls as required. I only mention this because I'm dealing with some usercontols where the developers manipulated contained controls in form code, wreaking encapsulation.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform