GrapeCity MultiRow Windows Forms Documentation
Display Alternate Image for Empty Value (ImageCell)

Use the ImageCell.Style.NullValue property (CellStyle.NullValue property) if you wish to specify an alternate image when the image cell value is empty or does not have an image.

Using the Designer

  1. Add an image cell in a row (for example: imageCell1).
  2. Select imageCell1 and set an image in the imageCell1.Style.NullValue property in the Properties window.

Using Code

This example creates an alternate image for an empty value.

[VB]

Imports GrapeCity.Win.MultiRow

Dim template As Template = New Template()
Dim columnHeaderSection1 As ColumnHeaderSection = New ColumnHeaderSection()
Dim columnHeaderCell1 As ColumnHeaderCell = New ColumnHeaderCell()

Dim imageCell1 As ImageCell = New ImageCell()
imageCell1.Style.NullValue = New Bitmap("PlaceHolder.png")
template.Width = imageCell1.Size.Width
template.Row.Cells.Add(imageCell1)
template.Row.Height = imageCell1.Size.Height

columnHeaderSection1.Cells.Add(columnHeaderCell1)
columnHeaderSection1.Height = columnHeaderCell1.Size.Height
template.ColumnHeaders.Add(columnHeaderSection1)

GcMultiRow1.Template = template
GcMultiRow1.RowCount = 10

[CS]

using GrapeCity.Win.MultiRow;

Template template = new Template();
ColumnHeaderSection columnHeaderSection1 = new ColumnHeaderSection();
ColumnHeaderCell columnHeaderCell1 = new ColumnHeaderCell();

ImageCell imageCell1 = new ImageCell();
imageCell1.Style.NullValue = new Bitmap(@"PlaceHolder.png");
template.Width = imageCell1.Size.Width;
template.Row.Cells.Add(imageCell1);
template.Row.Height = imageCell1.Size.Height;

columnHeaderSection1.Cells.Add(columnHeaderCell1);
columnHeaderSection1.Height = columnHeaderCell1.Size.Height;
template.ColumnHeaders.Add(columnHeaderSection1);

gcMultiRow1.Template = template;
gcMultiRow1.RowCount = 10;
See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options