Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How do you change columns in a listview

$
0
0

 I have a dataset that I want to display the error if I get an error returned from the database. Otherwise, I would like to display the data.

I can't find anything that states that listview items can be visible. So, I generated two listviews and I was going to set the style of one be visible and hidden depending on the success value.

<Style TargetType="ListView" x:Name="hideifsuccessfulstyle"><Style.Triggers><DataTrigger Binding="{Binding Path=Success}" Value="1"><Setter Property="Visibility" Value="Hidden" /></DataTrigger></Style.Triggers></Style><Style TargetType="ListView" x:Name="displayifsuccessfulstyle"><Style.Triggers><DataTrigger Binding="{Binding Path=Success}" Value="1"><Setter Property="Visibility" Value="Visible" /></DataTrigger></Style.Triggers></Style>

However, I get an error when running it. I believe it is because I'm using the target type twice. When I remove one of the items, it will work, but I can't get to my goal with only changing one list.

http://connect.microsoft.com/VisualStudio/feedback/details/629329/better-information-about-the-runtime-error-you-get-when-having-multiple-keys-in-an-xaml-file

 

 

Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>