Telerik UI for Windows 8 XAML

The DataGridBooleanColumn is used to represent boolean values. It uses CheckBox control to edit its values in EditMode.


The following example shows how to generate DataGridBooleanColumns manually:

XAML Copy imageCopy
<telerikGrid:RadDataGrid ItemsSource="{Binding}" AutoGenerateColumns="False">
        <telerikGrid:DataGridTextColumn PropertyName="Product" Header="Product"/>
        <telerikGrid:DataGridBooleanColumn PropertyName="Stock" Header="Stock"/>
Boolean Column

We have also used the PropertyName property to associate each column with the relevant property from our model.

Here is the data:

C# Copy imageCopy
this.DataContext = new List<Data>()
    new Data { Product = "Milk", Stock = true },
    new Data { Product = "Cheese", Stock = false },
    new Data { Product = "Bread", Stock = false },
    new Data { Product = "Chocolate", Stock = true } 

Data is our custom class:

C# Copy imageCopy
public class Data
    public string Product { get; set; }
    public bool Stock { get; set; }