Back to Devexpress

GridBand.ImageIndex Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-bandedgrid-dot-gridband-8cd1c9e2.md

latest3.2 KB
Original Source

GridBand.ImageIndex Property

Use the ImageIdex option accessible in GridBand.ImageOptions to specify the index of the image displayed within the band header.

Namespace : DevExpress.XtraGrid.Views.BandedGrid

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
[DefaultValue(-1)]
[DXCategory("Appearance")]
[EditorBrowsable(EditorBrowsableState.Never)]
[ImageList("Images")]
[XtraSerializableProperty]
public int ImageIndex { get; set; }
vb
<Browsable(False)>
<EditorBrowsable(EditorBrowsableState.Never)>
<DXCategory("Appearance")>
<DefaultValue(-1)>
<ImageList("Images")>
<XtraSerializableProperty>
Public Property ImageIndex As Integer

Property Value

TypeDefaultDescription
Int32-1

A zero-based integer specifying the image by its index within the source collection. -1 if no image is displayed within the band header.

|

Remarks

The ImageIndex property specifies the index of the required image in the collection of images. The source of images is specified by the ColumnView.Images property.

The image below shows examples of band header and column header images.

Tip

You can also assign an image by its name in the collection.

csharp
// The image collection is created and populated with images at design time.
barItem.ImageOptions.Image = imageCollection1["technology_32x32"]; 
// Assign an SVG image in the SvgCollection
// barItem.ImageOptions.SvgImage = svgCollection1["technology_32x32"];
vb
' The image collection is created and populated with images at design time.
barItem.ImageOptions.Image = imageCollection1("technology_32x32")
' Assign an SVG image in the SvgCollection
' barItem.ImageOptions.SvgImage = svgCollection1["technology_32x32"];

Read the following help topic for more information: Access and Use DevExpress Icons in Code.

See Also

ImageOptions

GridBand Class

GridBand Members

DevExpress.XtraGrid.Views.BandedGrid Namespace