我对 Silverlight 应用程序非常陌生。我最近一天一直在尝试这个,但我还是做不到。就我而言,它需要单击三下才能打开组合框。
我的 XAML 代码:
<sdk:DataGridTemplateColumn Header="Category" Width="100">
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox Name="cmbCategory"
IsDropDownOpen="True"
ItemsSource="{Binding Source={StaticResource MyViewModel},Mode=OneWay,Path=pcProjTypeTaskCtry}"
DisplayMemberPath="TaskCtgyName" SelectedValuePath="TaskCtgy_FK"
SelectedValue="{Binding piTaskCtgy_FKField,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ToolTipService.ToolTip="{Binding psTaskCtgyNameField,UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
<sdk:DataGridTemplateColumn Header="SubCategory" Width="110">
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Name="tbSubCategory" Text="{Binding Path=psTaskSubCtgyNameField,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ToolTipService.ToolTip="{Binding psTaskSubCtgyNameField}" >
</TextBlock>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
<sdk:DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding Source={StaticResource MyViewModel},Mode=TwoWay,Path=pcTaskSubCtry}"
DisplayMemberPath="TaskSubCtgyName" SelectedValuePath="TaskSubCtgyName"
SelectedItem="{Binding Source={StaticResource MyViewModel},Path=SelectedSubTask,Mode=TwoWay}"
SelectedValue="{Binding psTaskSubCtgyNameField,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ToolTipService.ToolTip="{Binding psTaskSubCtgyNameField}">
</ComboBox>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellEditingTemplate>
</sdk:DataGridTemplateColumn>