Write a program that adds two columns binded with the same properties and having column headings using XAML?

Write a program that adds two columns binded with the same properties and having column headings using XAML?



- Columns can be added in their own way by making two different columns and adding them using the function of Column.Add().

- The order of the columns is not determined by the order in which they are shown or stored. To list the order use of DisplayIndex property is used.

- To add the columns that are binded with one another first there is a need to create the data and add the data to the items collection.

- XAML is used to instantiate and initialize the two columns and produces the same result with the in-built function as normal language.

<DataGrid Height="50"
HorizontalAlignment="Right"
Margin="7,9,0,0"
Name="dataGrid"
VerticalAlignment="Top"
Width="100" >
<DataGrid.Columns>
<DataGridTextColumn
Binding="{Binding Path=name}"
Header="Name">
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Path=age}
Header="Age">
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
Post your comment