DataGrid Control In WPF

The DataGrid provides provides AutoGenerateColumns Feature, which is used to generate columns according to the requirement of our data Objects.

<DataGrid ItemsSource="{Binding Students}" />

 

It has the following types of columns:

1)       TextBox columns, which is used to store string values

2)       Hyperlink columns, which is used to store Uri values

3)       ComboBox columns, which is used to store enumerable values

4)       CheckBox columns, which is used to store boolean values

Or we can define it manually, In this case we set the AutoGenerateColumns property to False

1)      DataGridTextColumn to show string values

2)      DataGridHyperlinkColumn for Uri values

3)      DataGridComboBoxColumn for enumerable values

4)      DataGridCheckBoxColumn for boolean values