Write a program to display the use of multiple columns in DataGrid?
Write a program to display the use of multiple columns in DataGrid?
- The DataGrid that is used contains the provision to have multiple columns to contain the data in an easy and ordered way.
- Every column in the multiple columns is having different property of the objects and having collection of items.
- The objects are named according to the properties given from get/set properties and the public data field in this case can’t be created.
- The program that shows the creation of multiple columns in DataGrid is as follows:
public struct MyData
{
public string name { set; get; }
public int age { set; get; }
}
dataGrid1.Items.Add(
new MyData(){name="John",age=25});
dataGrid1.Items.Add(
new MyData(){name = "Jill",age = 29 });