MultiRow Windows Forms > Developer's Guide > Using MultiRow > Cell Types > ImageCell > 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.
This example creates an alternate image for an empty value.
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 |
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; |