目前做一个列表,datagrid用了模板列,列下分为3个textbox以横线隔开,相当于合并单元格。
<DataGridTextColumn Header="列名" Binding="{Binding ZQDGL13, Mode=TwoWay}" Width="50" ElementStyle="{StaticResource contentCenterStyle}"/>
<DataGridTemplateColumn Header="合并单元格的" Width="50" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50*"/>
<RowDefinition />
<RowDefinition Height="50*"/>
<RowDefinition />
<RowDefinition Height="50*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" x:Name="Baifenbi1" Text="{Binding Path=ZQDGL14.Baifenbi1, Mode=TwoWay}" VerticalAlignment="Center" Margin="3,3,3,3"/>
<Line Grid.Row="1" Stroke="Black" Stretch="Fill" X2="1" VerticalAlignment="Center"/>
<TextBlock Grid.Row="2" x:Name="Baifenbi2" Text="{Binding Path=ZQDGL14.Baifenbi2, Mode=TwoWay}" VerticalAlignment="Center" Margin="3,3,3,3"/>
<Line Grid.Row="3" Stroke="Black" Stretch="Fill" X2="1" VerticalAlignment="Center"/>
<TextBlock Grid.Row="4" x:Name="Baifenbi3" Text="{Binding Path=ZQDGL14.Baifenbi3, Mode=TwoWay}" VerticalAlignment="Center" Margin="3,3,3,3"/>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

运行后 其他单元格都可以双击编辑,唯独这个合并模板,选中时选的是整个单元格,无法选中其中的某个textbox,也无法编辑textbox内容
请教如何实现编辑和单独选中啊。