The CheckBoxViewer can be used to view the content of cells which have a boolean datatype.
By default, the CheckBoxViewer will be created as the CellViewerManager for all columns in the grid which have a boolean datatype.
The image of the checkbox used by the CheckBoxViewer can be retrieved using the GetImage method. The image that is returned will represent the checkbox in its current state. By default, the ImageArea property of the CheckBoxViewer is set to ImageArea.AllContent indicating that no text is displayed and that the image (checkbox) occupies the entire space.
If a CellViewerManager other than the CheckBoxViewer is desired by default for columns which have a boolean datatype, the GridControl's CellViewerManagerMapping property can be modified. For example:
VB.NET | Copy Code |
---|---|
GridControl1.CellViewerManagerMapping( GetType( Boolean ) ) = New BooleanImageTextViewer() |
C# | Copy Code |
---|---|
gridControl1.CellViewerManagerMapping[ typeof( bool ) ] = new BooleanImageTextViewer(); |
If a different CellViewerManager is required for only one column or cell, the CellViewerManager property of the specific column or cell can be set rather than changing the default CellViewerManager that is created for all boolean columns via the CellViewerManagerMapping property.
VB.NET | Copy Code |
---|---|
GridControl1.Columns( "Arrived" ).CellViewerManager = New BooleanImageTextViewer() |
C# | Copy Code |
---|---|
gridControl1.Columns[ "Arrived" ].CellViewerManager = new BooleanImageTextViewer(); |
The underlying control wrapped by the CheckBoxViewer is the WinCheckBox control and is accessible through the Control property. All settings relating to the underlying control must be accessed via the Control property.
More information regarding the WinCheckBox control can be found in the WinCheckBox control topic.