我需要使用datagrid中的updown按钮更改文本框并获取当前值
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="20"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="1"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="txtNum"
TextChanged="TxtNum_TextChanged" VerticalAlignment="Center" />
<Button x:Name="cmdUp" Grid.Column="2" Grid.Row="2" Click="cmdUp_Click"/>
<Button x:Name="cmdDn" Grid.Column="2" Grid.Row="0"/ ></Button>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>