我正试图让一个文本框显示在列表视图的一列中,该列也使用GridView。
<ListView Margin="30,120,0,0" Name="EquipmentView" SelectionChanged="EquipmentView_SelectionChanged" ItemsSource="{Binding}" Foreground="Black" FontWeight="Normal" FontFamily="Segui Bold" HorizontalAlignment="Left" Width="329" Height="100" VerticalAlignment="Top">
<ListView.View>
<GridView>
<GridViewColumn Header="Control" Width="175" DisplayMemberBinding="{Binding Path=Control}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=ControlBlock}" Width="Auto" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Setting" Width ="150" DisplayMemberBinding="{Binding Path=Setting}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Path=SettingText}" Width="Auto" GotFocus="TextBox_GotFocus" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
但当我执行上述操作时,我将列表视图作为网格,但我无法查看或编辑文本框。任何帮助都将不胜感激。提前谢谢。