在 WPF 中,如何在单击 GridViewColumn 时触发事件?
我有很多GridViewColumns
这样的;我想,当用户点击它时,显示一个更新表单来更新一些数据。我怎么能这样做?
<GridViewColumn util:GridViewSort.PropertyName="Username" >
<GridViewColumn.HeaderTemplate>
<DataTemplate>
<Label Width="130" Height="25" Margin="10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" Content="Username" Foreground="Black" />
</DataTemplate>
</GridViewColumn.HeaderTemplate>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<Label Height="30" Margin="7,0,0,0" HorizontalAlignment="left" VerticalAlignment="Center" Content="{Binding Path=Username}" Foreground="Black" />
</Grid>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>