Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
1 of 2
Rakesh
  • 4.3k
  • 2
  • 21
  • 31
<DataGrid x:Name="employeeGrid" HorizontalAlignment="Center" VerticalAlignment="Center" AlternatingRowBackground="LightBlue" AlternationCount="2" AutoGenerateColumns="False" ItemsSource="{Binding}">
        <DataGrid.Columns>
            <DataGridTextColumn Header="Emp #" Binding="{Binding EmpId}"/>
            <DataGridTextColumn Header="First Name" Binding="{Binding FirstName}"/>
            <DataGridTextColumn Header="Last Name" Binding="{Binding LastName}"/>
        </DataGrid.Columns>
    </DataGrid>

Following goes in your corresponding .cs file:

employeeGrid.ItemsSource = employeeDetails;

Rakesh
  • 4.3k
  • 2
  • 21
  • 31