WPF ListView添加了ContextMenu之后如何删除掉ListView的某列
代码如下:<ListViewName="keyWordsList"Margin="10,79,469,97"Grid.Column="0"ItemsSource="{Bi...
代码如下:
<ListView Name="keyWordsList" Margin="10,79,469,97" Grid.Column="0" ItemsSource="{Binding}">
<ListView.View>
<GridView>
<GridViewColumn Header="KeyWord" Width="80" DisplayMemberBinding="{Binding Path=KeyWords}"></GridViewColumn>
<GridViewColumn Header="Link" Width="120" DisplayMemberBinding="{Binding Path=Links}"></GridViewColumn>
</GridView>
</ListView.View>
<ListView.ContextMenu>
<ContextMenu Name="KeyWordsMenu">
<MenuItem Header="删除" Name="KeyWordsMenuDelete" Click="KeyWordsMenuDelete_click"></MenuItem>
</ContextMenu>
</ListView.ContextMenu>
</ListView>
我想知道,我右击菜单然后点了删除之后,如何获取右键选中的ListView的序列或者内容。
本人菜鸡,请大婶耐心指点,谢谢! 展开
<ListView Name="keyWordsList" Margin="10,79,469,97" Grid.Column="0" ItemsSource="{Binding}">
<ListView.View>
<GridView>
<GridViewColumn Header="KeyWord" Width="80" DisplayMemberBinding="{Binding Path=KeyWords}"></GridViewColumn>
<GridViewColumn Header="Link" Width="120" DisplayMemberBinding="{Binding Path=Links}"></GridViewColumn>
</GridView>
</ListView.View>
<ListView.ContextMenu>
<ContextMenu Name="KeyWordsMenu">
<MenuItem Header="删除" Name="KeyWordsMenuDelete" Click="KeyWordsMenuDelete_click"></MenuItem>
</ContextMenu>
</ListView.ContextMenu>
</ListView>
我想知道,我右击菜单然后点了删除之后,如何获取右键选中的ListView的序列或者内容。
本人菜鸡,请大婶耐心指点,谢谢! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询