What are the ways that properties can be shown in DataGrid?

What are the ways that properties can be shown in DataGrid?



- DataGrid shows the properties in the form of columns and each column store some value.

- DataGrid need two columns and each of them is bound to have one property each and that is also different from one another.

- After creating the two columns with the properties the binding should be done of those columns to display the data.

The ways are being shown as:

DataGridTextColumn col1 = new DataGridTextColumn();
col1.Binding = new Binding("name");

DataGridTextColumn col2 =
new DataGridTextColumn();
col2.Binding = new Binding("age");

dataGrid1.Columns.Add(col1);
dataGrid1.Columns.Add(col2);
Post your comment