Posted 8 September 2017, 1:47 pm EST
Hi Scott or Bob,
We have a column which is CheckBoxCellType and will show a Tick image if is True, cross image if it is False.
However, for some rows in this column, there are actually no data. The value is Nothing. But, it is still showing False image. We want those when value is nothing, it return no image at all.
As I understand that False is a default values, so we are thinking of using Indeterminate state. When value is Nothing, set the state to Indeterminate.See attached file for print screen.
We have create class to try to achieve, but fail to do so.
<font size="1"> Imports FarPoint.Win.Spread.CellType
Public Class ReportBooleanStyleCellType
Public Sub New(ByVal showTrueImage As Boolean, ByVal showFalseImage As Boolean)
If showTrueImage Then
Me.Picture.TrueDisabled = InvestmentManager.Images.ReportTrue
Me.Picture.TrueDisabled = InvestmentManager.Images.ReportEmpty
If showFalseImage Then
Me.Picture.FalseDisabled = InvestmentManager.Images.ReportFalse
Me.Picture.FalseDisabled = InvestmentManager.Images.ReportEmpty
Public Overrides Sub PaintCell(ByVal g As System.Drawing.Graphics, ByVal r As System.Drawing.Rectangle, ByVal appearance As FarPoint.Win.Spread.Appearance, ByVal value As Object, ByVal isSelected As Boolean, ByVal isLocked As Boolean, ByVal zoomFactor As Single)
If value IsNot Nothing AndAlso TypeOf value Is Boolean Then
MyBase.PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor)
It works find on the spread view, and export to PDF, export to CSV.
But, when we export the spread to Excel, the column in Excel
will have those Value=Nothing row replaced with False instead of showing
Is there a way to achieve this?
Means, when Cell.Value is True or False, it set the True/False image. When Cell.Value is Nothing, it dont show image and the Value is still Nothing when export to Excel.