日期:2014-05-16  浏览次数:20846 次

请教 wpf关于datagrid如何获取上一行/下一行的问题

<DataGrid Name="DGList2"  AutoGenerateColumns="False" HorizontalGridLinesBrush="#FFDCD5D5" VerticalGridLinesBrush="#FFDCD5D5" SelectionUnit="FullRow" IsReadOnly="True"  >
                    <DataGrid.Columns >
                        <DataGridTextColumn  Header="ID" Visibility="Collapsed" Width="100" Binding="{Binding ID}"/>
                        <DataGridTextColumn Header="公共类型" Width="100" Binding="{Binding FTopName}"/>                       
                        <DataGridTemplateColumn Header="排序" Width="100*" >
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <Grid.ColumnDefinitions> 
                                            <ColumnDefinition></ColumnDefinition>
                                            <ColumnDefinition></ColumnDefinition>
                                        </Grid.ColumnDefinitions>
                                        <Image Height="23" Width="15" Grid.Column="0" Cursor="Hand" Source="/Images/up.ico" MouseLeftButtonDown="Image_MouseLeftButtonDown_1" ></Image>
                                        <Image Height="23" Width="15" Grid.Column="1" Cursor="Hand" Source="/Images/