views:

66

answers:

1

Hi,

I'm trying to provide the same design-time support that the CssClass provides on some custom properties of a server control. The documentation suggests that decorating the property with the CssClassProperty is all that's required.

[CssClassProperty]
public string SomeOtherCssClass{get;set;}

This has no effect, in vs2008 or vs2010. I've looked at the WebControl class using reflector and implemented all the attributes, and every combination thereof, to my property and still no class dropdown. Some blog posts suggest that the use of the Editor attribute but a) there's not mention of it in the documentation and b) none of editors which are remotely related to css classes have any effect either. Am I missing something to enable this feature?

Thanks in advance,

Keith.

A: 

Hi Keith,

Did you ever resolve this as I can not get that attribute to encourage the CSS style browser to pop up either.

The code I used was:

    /// <summary>
    /// Gets or sets the item CSS class.
    /// </summary>
    /// <value>The item CSS class.</value>
    [Browsable(true)]
    [Category("Appearance")]
    [CssClassProperty]
    public string ItemStyleCssClass
    {
        get { return this._itemStyleCssClass; }
        set { this._itemStyleCssClass = value; }
    }

Cheers, Duane.

Duane Wingett