please try this method:
XAML:
<DataGrid x:Name="dataGrid" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Value.Name}"/>
<DataGridTextColumn Header="Age" Binding="{Binding Value.Age}"/>
<DataGridTextColumn Header="Address" Binding="{Binding Value.Address}"/>
</DataGrid.Columns>
</DataGrid>
Code-Behind:
private void dataGridInit()
{
SortedList<int, Person> list = new SortedList<int, Person>();
list.Add(2, new Person() {Name = "James", Age = 30, Address = "some place" });
list.Add(1, new Person() { Name = "Kitty", Age = 28, Address = "some place" });
list.Add(3, new Person() { Name = "Deko", Age = 28, Address = "some place" });
dataGrid.DataContext = list;
dataGrid.ItemsSource = list;
}
Person Class:
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
public string Address { get; set; }
}