To show a checkbox column for a Boolean property in a DataGrid, you typically bind the column to a bool property. Below are the most common cases used in .NET / WPF / WinForms, which are often asked in interviews.
✅ WPF DataGrid (Most Common Interview Answer)
Use DataGridCheckBoxColumn.
🔹 Example Model
public class User
{
public string Name { get; set; }
public bool IsActive { get; set; }
}
🔹 XAML DataGrid
<DataGrid ItemsSource="{Binding Users}" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}" />
<DataGridCheckBoxColumn Header="Active"
Binding="{Binding IsActive}" />
</DataGrid.Columns>
</DataGrid>
✔ Automatically displays a checkbox
✔ Two-way binding by default
✔ Works for bool property
✅ Editable Checkbox (Template Column – Advanced)
Use this when you need custom behavior.
<DataGridTemplateColumn Header="Active">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsActive}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
✅ WinForms DataGridView
Use DataGridViewCheckBoxColumn.
DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn();
chk.HeaderText = "Active";
chk.DataPropertyName = "IsActive";
dataGridView1.Columns.Add(chk);
✅ ASP.NET MVC Grid (Interview Bonus)
@Html.CheckBoxFor(model => model.IsActive)
Or inside a Grid:
@Html.CheckBox("IsActive", item.IsActive)
🔑 Interview One-Line Answer
To show a checkbox column in a DataGrid for a Boolean property, use
DataGridCheckBoxColumnand bind it to the Boolean field.

