我的radganttview由许多列组成,其中单元格模板主要作为标签,而单元格编辑模板则作为组合框/文本框。我想在任何单元格编辑模板中按Enter键时,下一行的同一列单元格应获得焦点,被选中并处于编辑模式。 我尝试将其绑定到radganttview交互行为,但未成功。
示例列定义:
<telerik:ColumnDefinition Header="Pred. Type" AutomationProperties.AutomationId="PredType"
Width="50"
MemberBinding="{Binding PredType}"
IsResizable="False">
<telerik:ColumnDefinition.CellEditTemplate>
<DataTemplate>
<telerik:RadComboBox
x:Name="PredTypeComboBox"
DisplayMemberPath="Value"
SelectedValuePath="Key"
SelectedValue="{Binding PredType}"
ItemsSource="{Binding DataContext.PredTypes,
RelativeSource={RelativeSource FindAncestor,
AncestorType=schedule:ScheduleView}}" />
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding HasChildren}" Value="true">
<Setter TargetName="PredTypeComboBox" Property="Visibility" Value="Collapsed" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</telerik:ColumnDefinition.CellEditTemplate>
<telerik:ColumnDefinition.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding FormattedValue}"
Margin="-4,1"
HorizontalAlignment="Center"
Visibility="{Binding OriginalEvent.HasChildren, Converter={StaticResource InverseBooleanToVisibilityConverter}}"
VerticalAlignment="Center" />
</DataTemplate>
</telerik:ColumnDefinition.CellTemplate>
</telerik:ColumnDefinition>