Click or drag to resize
Style Class
Represents the content and appearance of a grid cell.
Inheritance Hierarchy
SystemObject
  Stingray.GridStyle

Namespace: Stingray.Grid
Assembly: Stingray.GridControl (in Stingray.GridControl.dll) Version: 14.0.0.0
Syntax
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public class Style : IDisposable

The Style type exposes the following members.

Methods
  NameDescription
Public methodClone
Creates a new Style that is a copy of the current instance.
Top
Properties
  NameDescription
Public propertyAllowEnter
Gets or sets the Allow enter property.
Public propertyAutoSize
Gets or sets the auto size property.
Public propertyBorders
Gets or sets the appearance of cell borders.
Public propertyChoiceList
Gets or sets choice list values.
Public propertyControl
Gets or sets the type of the embedded control.
Public propertyCustomControl
Sets the custom control to use with this cell.
Public propertyCustomControlHandle
Gets the custom control handle for the custom control used in this style.
Public propertyDraw3dFrame
Gets or sets the 3D effect of the cell.
Public propertyEllipseType
Gets or sets the type of ellipsis used when the text is longer than the cell.
Public propertyEnabled
Gets or sets the enabled state for the cell.
Public propertyFloatCell
Gets or sets the float cell property.
Public propertyFloodCell
Gets or sets the flood cell property.
Public propertyFormat
Gets or sets the numeric format for the cell.
Public propertyHorzAlign
Gets or sets the horizontal alignment for a cell .
Public propertyIncludeAllowEnter
Gets or sets the state of the AllowEnter property.
Public propertyIncludeAutoSize
Gets or sets the state of the AutoSize property.
Public propertyIncludeBorders
Gets or sets the state of the Borders property.
Public propertyIncludeChoiceList
Gets or sets the state of the ChoiceList property.
Public propertyIncludeControl
Gets or sets the state of the Control property.
Public propertyIncludeDraw3dFrame
Gets or sets the state of the Draw3dFrame property.
Public propertyIncludeEnabled
Gets or sets the state of the Enabled property.
Public propertyIncludeFloatCell
Gets or sets state of the FloatCell property.
Public propertyIncludeFloodCell
Gets or sets the state of the FloodCell property.
Public propertyIncludeFormat
Gets or sets whether the Format property is set.
Public propertyIncludeHorzAlign
Gets or sets the state of the HorzAlign property.
Public propertyIncludeInterior
Gets or sets the state of the Interior property.
Public propertyIncludeItemData
Gets or sets the state of the ItemData property.
Public propertyIncludeMaxLength
Gets or sets the state of the MaxLength property.
Public propertyIncludeMergeCell
Gets or sets the state of the MergeCell property.
Public propertyIncludePlaces
Gets or sets whether the Places property is set.
Public propertyIncludeReadOnly
Gets or sets the state of the ReadOnly property.
Public propertyIncludeTextColor
Gets or sets the state of the TextColor property.
Public propertyIncludeTextFont
Gets or sets the state of the TextFont property.
Public propertyIncludeTriState
Gets or sets the state of the TriState property.
Public propertyIncludeValue
Gets or sets the state of the Value property.
Public propertyIncludeVertAlign
Gets or sets the state of the VertAlign property.
Public propertyIncludeVerticalScroll
Gets or sets the state of the VerticalScroll property.
Public propertyIncludeWrapText
Gets or sets the state of the WrapText property.
Public propertyInitialValue
Gets or sets the initial value of the spin control.
Public propertyInterior
Gets or sets the brush that is used to draw the interior area of a cell.
Public propertyItemData
Gets or sets a pointer to a user defined item data.
Public propertyLowerBound
Gets or sets the lower bound of the spin control.
Public propertyMask
Gets or sets a user-specified mask string.
Public propertyMaxLength
Gets or sets the maximum length of the stored value.
Public propertyMergeCell
Gets or sets how neighboring cells can be merged.
Public propertyOnlyNumericValues
Gets or sets whether the cell(s) contain only numeric values.
Public propertyPlaces
Gets or sets the number of decimal places displayed in numeric cells.
Public propertyPrompt
Gets or sets the user-specified input prompt.
Public propertyReadOnly
Gets or sets the cell's read-only state.
Public propertyTextColor
Gets or sets the color of text in a cell.
Public propertyTextFont
Gets or sets the cell's text font.
Public propertyToolTip
Gets or sets the string used for the cell tool tip.
Public propertyTriState
Gets or sets the tri-state property of the cell
Public propertyTypeOf
Gets or sets the type of the value.
Public propertyUpperBound
Gets or sets the upper bound of the spin control.
Public propertyValidateMessage
Gets or sets the message to be displayed if the Style value is invalid.
Public propertyValidMaximum
Gets or sets the highest valid value.
Public propertyValidMinimum
Gets or sets the lowest valid value.
Public propertyValue
Gets or sets the value stored in the cell.
Public propertyVertAlign
Gets or sets the vertical alignment for the cell.
Public propertyVerticalScroll
Gets or sets the vertical scroll bar in a cell.
Public propertyWrapText
Gets or sets text wrap.
Public propertyWrapValue
Gets or sets the wrap property of a spin control.
Top
Remarks
A Style object contains all the information necessary for formatting a grid cell. A style consists of several attributes such as the text color, borders, control type, and font attributes. These styles can be modified by the end user using a .NET property grid.

An important feature of GridControl is its support for combining style objects. For example, you can copy only those attributes from one style to another style that are not initialized in the other style. This feature enables a kind of inheritance. By specifying a base style, GridControl inherits attributes from the base style at run time.

Base styles make it possible to group specific kinds of cells and give them similar attributes. The predefined base styles are:

  • row-header-style
  • column-header-style
  • standard-style

Row header cells inherit their attributes from row-header-style. Column headers inherit from column-header-style. standard-style is the base style for all cells in the grid.

Properties in the Style class are combined with an include-bit. This include-bit is true when an attribute is initialized and false if the attribute is not initialized. When the grid is drawn uninitialized, style properties of the cell's style object are filled with the base style's properties. If the Include<*> properties are false, Stingray Grid .NET tries to initialize the properties with the base style's setting. If Include<*> properties return true, the specific setting is used for drawing.

Note Note
The values returned from Style properties are to be considered valid ONLY if the corresponding Include<*> property returns true. For example, the value of the ReadOnly property is valid ONLY if the IncludeReadOnly property is true.

Most of the properties of a Style can be configured at design time in the designer property grid. However, at this time, the following properties can be configured only at run time through source code manipulation:

See Also