When you bind a collection of objects to a DataGrid, it creates data grid rows for each object present in the collection. The column defines the properties exposed by the object.
When the AutoGenerateColumns property of the DataGrid is set to True (default), it automatically creates the columns based on the property list. In this example, we have set the AutoGenerateColumns property to False and defined the individual columns explicitly. Using this method, you can define which column to show or hide. Once you set the collection to the ItemsSource property of the DataGrid, it populates the rows and columns accordingly.