DataGrid BooleanColumn
The DataGridBooleanColumn
is used to represent boolean values. It uses the CheckBox control to edit its values in EditMode.
Important Properties
-
PropertyName
—Specifies the name of the property of the object type that represents each row within the grid. -
HeaderText
—Defines the content that will be displayed in the Header UI that represents the column. -
CellContentStyle
—Defines theStyle
object that sets the appearance of each cell associated with this column. TheTargetType
of theStyle
has to be of theTextBlock
type. -
CellContentStyleSelector
—Defines theStyleSelector
instance that allows for the dynamic appearance on a per-cell basis. -
CellContentFormat
—Defines the custom format for each cell value. TheString.Format
routine is used and the format passed has to be in the form required by this method. -
CellContentTemplate
(DataTemplate
)—Defines the appearance of each cell associated with the concrete column. TheCellContenTemplate
enables you to wrap the text inside each DataGrid column. You can add a Label as a content of the Text and Template Column and wrap its text using theLineBreakMode
Label property. -
CellEditTemplate
(DataTemplate
)—Defines the editor associated with the concrete column. TheCellEditTemplate
is displayed when the cell is in edit mode.
For more information about
CellDecorationStyle
andCellDecorationStyleSelector
, refer to the Columns Styling topic.
CellContentFormat
uses the format string provided by the framework. For more details, refer to theString.Format
article.
Example
<telerik:DataGridBooleanColumn PropertyName="IsChampion"
HeaderText="Champion?">
<telerik:DataGridBooleanColumn.CellContentStyle>
<telerik:DataGridTextCellStyle TextColor="Green"
FontSize="18"
SelectedTextColor="Blue" />
</telerik:DataGridBooleanColumn.CellContentStyle>
</telerik:DataGridBooleanColumn>