Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Method to set all controls Enabled property to false
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Method to set all controls Enabled property to false
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01319086
Message ID:
01319086
Views:
57
Hi everybody,

I'm working on UserControls. In each User Control I've added a Property called EditMode.
public partial class Coordinator_UCD_SpecialFriend : System.Web.UI.UserControl
{    
    #region Custom Properties
    ///
    /// <summary>The EditMode property is responsible for the Enabled style of the controls</summary>
    ///
 
    private bool editMode ;
    [Description("The EditMode property is responsible for the Enabled style of the controls"), DefaultValue(true)]  
    public bool EditMode
    {
        get { return editMode ; }
        set {
            editMode = value;           
        }
    }
    #endregion
When I set this property, I want to set all its inner controls Enabled property to the passed value.

Also can I have this as a static method in our public static class? If yes, what should I pass to this method?

In VFP I would do something like
this.EditMode = value
myStaticClass.SetEnabledProperty(this, value)
and the SetEnabledProperty method would be something like
lparameter loObject as Control
for each loControls in loObject.Controls
  ...
next
How can I translate something like this into C# code?

Thanks in advance for the ideas.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform