WPF 4 Datagrid row with UP DOWN button

=========================================XAML Code=========================================
<Window x:Class="DataView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="UpdateGrade" Height="400" Width="400" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
 
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="333*"/>
            <ColumnDefinition Width="61*"/>
        </Grid.ColumnDefinitions>
        
        <DataGrid Name="dgDataView" ItemsSource="{Binding Data}" AutoGenerateColumns="False" IsReadOnly="True" SelectionMode="Single">
 
            <DataGrid.Columns>
                <DataGridTemplateColumn Header="Name" Width="150">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
        
        <StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
            <Button Name="btnUP" Content="UP" Margin="5"/>
            <Button Name="btnDown" Content="Down" Margin="5"/>
        </StackPanel>
    </Grid>
</Window>

 
=========================================VB Code=========================================

Private Sub btnUP_Click(sender As Object, e As RoutedEventArgsHandles btnUP.Click

        With Me.dgDataView
              If .SelectedItem Is Nothing Then Exit Sub

        Dim listItems As ObservableCollection(Of Item) = Me.dgDataView.ItemsSource
            Dim idx  As Integer = .SelectedIndex             If idx  > 0 Then                 Dim rememberMe As Object = .SelectedItem                 listItems.RemoveAt(idx)                 listItems.Insert(idx - 1, rememberMe)                 Me.dgDataView.ItemsSource = listItems                 .SelectedIndex = idx - 1             End If         End With     End Sub
    Private Sub btnDown_Click(sender As Object, e As RoutedEventArgsHandles btnDown.Click
 
        With Me.dgDataView
              If .SelectedItem Is Nothing Then Exit Sub

        Dim listItems As ObservableCollection(Of GradeItem) = Me.dgDataView.ItemsSource
            'Make sure our item is not the last one on the list.             If .SelectedIndex < .Items.Count - 1 Then                 Dim rememberMe As Object = .SelectedItem                 'Insert places items above the index you supply, since we want                 'to move it down the list we have to do + 2                 Dim idx = .SelectedIndex + 2                 listItems.Insert(idx, rememberMe)                 listItems.RemoveAt(.SelectedIndex)                 Me.dgDataView.ItemsSource = listItems                 .SelectedIndex = idx - 1             End If         End With     End Sub