--- title: "How to: Create ListViewItems with a CheckBox" ms.date: "03/30/2017" helpviewer_keywords: - "controls [WPF], ListView" - "controls [WPF], CheckBox" - "ListView controls [WPF], CheckBox controls" - "CheckBox control [WPF], ListView control" ms.assetid: f6d66c7f-906c-4f65-a55a-0ede9d00e26a --- # How to: Create ListViewItems with a CheckBox This example shows how to display a column of controls in a control that uses a . ## Example To create a column that contains controls in a , create a that contains a . Then set the of a to the . The following example shows a that contains a . The example binds the property of the to the property value of the that contains it. Therefore, when the that contains the is selected, the is checked. [!code-xaml[ListViewChkBox#CheckBoxDataTemplate](~/samples/snippets/csharp/VS_Snippets_Wpf/ListViewChkBox/CS/window1.xaml#checkboxdatatemplate)] The following example shows how to create a column of controls. To make the column, the example sets the property of the to the . [!code-xaml[ListViewChkBox#GridViewColumnCheckBox](~/samples/snippets/csharp/VS_Snippets_Wpf/ListViewChkBox/CS/window1.xaml#gridviewcolumncheckbox)] ## See also - - - - [ListView Overview](listview-overview.md) - [How-to Topics](listview-how-to-topics.md) - [GridView Overview](gridview-overview.md)