Back to Devexpress

ASPxColorEdit.ColumnCount Property

aspnet-devexpress-dot-web-dot-aspxcoloredit-e9d979b3.md

latest2.9 KB
Original Source

ASPxColorEdit.ColumnCount Property

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

Declaration

csharp
[DefaultValue(8)]
public int ColumnCount { get; set; }
vb
<DefaultValue(8)>
Public Property ColumnCount As Integer

Property Value

TypeDefaultDescription
Int328

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.

csharp
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);
     }
}
vb
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
aspx
<dx:ASPxColorEdit ID="ceGreenPalette" runat="server" ColumnCount="6">
</dx:ASPxColorEdit>

See Also

Color Editor

Color Editor Elements

Items

ASPxColorEdit Class

ASPxColorEdit Members

DevExpress.Web Namespace