Skip to main content
Tab

ASPxColorEdit.ColumnCount Property

Gets or sets the number of columns displayed in a color table.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(8)]
public int ColumnCount { get; set; }

Property Value

Type Default Description
Int32 8

An Int32 value that specifies the number of columns.

Remarks

Use the ColumnCount property to specify the number of columns that are displayed in a color table. The number of items are defined by the length of the ASPxColorEdit.Items collection.

This property is a wrapper of the ColorEditProperties.ColumnCount property.

Example

This example demonstrates how to customize the ASPxColorEditor Items collection. The image below shows the result.

ASPxColorEdit_GreenPalette

using System.Drawing;

protected void Page_Load(object sender, EventArgs e) {
     Color color = Color.Empty;
     // Create a green palette that contains 24 color items
     for (int i = 0; i < 24; i++) {
          color = Color.FromArgb(0, i * 256 / 24, 0);
          ceGreenPalette.Items.Add(color);
     }
}
See Also