我在 WPF中有一个名为“ListLoginDetails”的 ListView。在其中我通过 DataSet显示两列,即“User_Name”、“Password” 。现在我必须按升序和降序对 ListView进行排序。根据单击的按钮......
Home.Xaml:
<ListView Name="ListLoginDetails" ItemsSource="{Binding Path=Table}" Margin="18,0,0,0" Grid.RowSpan="3" >
<ListView.View>
<GridView x:Name="gridView">
<GridViewColumn Width="100" Header="User_Name" DisplayMemberBinding="{Binding Path=Id}" />
<GridViewColumn Width="140" Header="Password" DisplayMemberBinding="{Binding Path=Password}" />
</GridView>
</ListView.View>
</ListView>