Export (0) Print
Expand All

CatalogPartChrome.CreateCatalogPartChromeStyle Method

Creates the style object that supplies style attributes for each CatalogPart control rendered by the CatalogPartChrome object.

Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

protected virtual Style CreateCatalogPartChromeStyle(
	CatalogPart catalogPart,
	PartChromeType chromeType
)

Parameters

catalogPart
Type: System.Web.UI.WebControls.WebParts.CatalogPart

The control that is currently being rendered.

chromeType
Type: System.Web.UI.WebControls.WebParts.PartChromeType

The type of chrome for a particular control; one of the PartChromeType enumeration values.

Return Value

Type: System.Web.UI.WebControls.Style
A Style that contains style attributes for catalogPart.

ExceptionCondition
ArgumentNullException

The control that catalogPart refers to is null.

ArgumentOutOfRangeException

chromeType is not a PartChromeType.

The CreateCatalogPartChromeStyle method creates a Style object that is used by the CatalogPartChrome object to render a CatalogPart control.

Notes to Implementers

If you inherit from the CatalogPartChrome class, you can optionally override the CreateCatalogPartChromeStyle method, and merge the style information from the base method with custom style attributes that you want to add. For a demonstration, see the Example section.

The following code example demonstrates how to override the CreateCatalogPartChromeStyle method to change the background color of the catalog part control. For the full code required to run the example, including the Web page to host these controls, see the Example section of the CatalogPartChrome class overview.

protected override Style  CreateCatalogPartChromeStyle(CatalogPart catalogPart, PartChromeType chromeType)
{
    Style catalogStyle = base.CreateCatalogPartChromeStyle(catalogPart, chromeType);
    catalogStyle.BackColor = Color.Bisque;
    return catalogStyle;
}

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft