Back to Devexpress

ASPxColorEdit.Items Property

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

latest2.7 KB
Original Source

ASPxColorEdit.Items Property

Gets the collection of items displayed within the default color section of the color table.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public ColorEditItemCollection Items { get; }
vb
Public ReadOnly Property Items As ColorEditItemCollection

Property Value

TypeDescription
ColorEditItemCollection

A ColorEditItemCollection instance that is the collection of items.

|

Remarks

Use the Items property to access a collection of items, represented by the ColorEditItem objects, within the color editor. The collection provides methods and properties that allow you to add new items and remove existing ones, access individual items, etc.

This property is a wrapper of the ColorEditProperties.Items 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

ASPxColorEdit Class

ASPxColorEdit Members

DevExpress.Web Namespace