xaml grid
<DataGrid Grid.Row="0"
Grid.ColumnSpan="3"
Grid.RowSpan="2"
AlternatingRowBackground="#FFFCFFC3"
EnableColumnVirtualization="True"
EnableRowVirtualization="True"
ItemsSource ="{Binding GridDataSource,UpdateSourceTrigger=PropertyChanged,IsAsync=True}"
AutoGenerateColumns="False"
CanUserAddRows="False"
SelectionMode="Single"
VerticalContentAlignment ="Center"
HorizontalContentAlignment="Center"
VerticalGridLinesBrush="Black"
GridLinesVisibility ="All"
SelectedItem="{Binding GridSelectedItem }"
ef:DataGridAutoScrollBehavior.Autoscroll="{Binding Autoscroll}" >
<DataGrid.Columns>
<DataGridTextColumn x:Name="dgsr"
Header="Sr No"
Binding="{Binding LineNo}"
IsReadOnly="True"
Width="0.15*" />
<DataGridTextColumn x:Name="dgIcode"
Header="Code" IsReadOnly="True"
Binding="{Binding ItemCode}"
Visibility="Hidden"
Width="0" />
<DataGridTextColumn x:Name="dgPerticular"
Header="Description"
Binding="{Binding Particular}"
IsReadOnly="True"
Visibility="Visible"
Width="*"
CellStyle="{StaticResource DGCLeft}" />
<DataGridTextColumn x:Name="dgGross"
Header="G.Wt."
Binding="{Binding GrossWt, StringFormat=F2}"
Visibility="Visible" IsReadOnly="True"
Width="0.3*"
CellStyle="{StaticResource DGCRight}"/>
<DataGridTextColumn x:Name="dgredtuch"
Header=" Reading Fineness" Visibility="Hidden"
Binding="{Binding RedTunchPer}"
IsReadOnly="True"
Width="0.3*" />
<DataGridTextColumn x:Name="dgcomm"
Header="Fineness"
Binding="{Binding TunchPer}"
Visibility="Visible" IsReadOnly="True"
Width="0.3*" />
<DataGridTextColumn x:Name="dgFine"
Header="N.Wt." IsReadOnly="True"
Binding="{Binding FineWt, StringFormat=F2}"
Visibility="Visible" Width="0.3*"
CellStyle="{StaticResource DGCRight}"/>
<DataGridTextColumn x:Name="dgItemAMount"
Header="Rate" IsReadOnly="True"
Binding="{Binding Amt, StringFormat=F2}"
Visibility="Visible"
Width="0.3*"
CellStyle="{StaticResource DGCRight}"/>
<DataGridTextColumn x:Name="dgMrp"
Header="MRP" IsReadOnly="True"
Binding="{Binding Mrp, StringFormat=F2}"
Visibility="Hidden"
Width="0"
CellStyle="{StaticResource DGCRight}"/>
<DataGridTextColumn x:Name="dgTot"
Header="Total"
IsReadOnly="True"
Binding="{Binding TotalAmt, StringFormat=F2}"
Visibility="Visible" Width="0.3*"
CellStyle="{StaticResource DGCRight}" >
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>