aspnet-devexpress-dot-web-dot-aspxcoloredit-e9d979b3.md
Gets or sets the number of columns displayed in a color table.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
[DefaultValue(8)]
public int ColumnCount { get; set; }
<DefaultValue(8)>
Public Property ColumnCount As Integer
| Type | Default | Description |
|---|---|---|
| Int32 | 8 |
An Int32 value that specifies the number of columns.
|
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.
This example demonstrates how to customize the ASPxColorEditor Items collection. The image below shows the result.
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);
}
}
Imports System.Drawing
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim color As Color = Color.Empty
' Create a green palette that contains 24 color items
For i As Integer = 0 To 23
color = Color.FromArgb(0, i * 256 \ 24, 0)
ceGreenPalette.Items.Add(color)
Next i
End Sub
<dx:ASPxColorEdit ID="ceGreenPalette" runat="server" ColumnCount="6">
</dx:ASPxColorEdit>
See Also