Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF ListView turn off selection
    text
    copied!<p>I have a simple WPF ListView and a simple question:</p> <p>Is it possible to turn off the selection, so when user clicks row, the row is not highlighted?</p> <p><img src="https://artax.karlin.mff.cuni.cz/~konim5am/Vis/wpfGrid.png" alt="ListView"></p> <p>I would like the row 1 to look just like row 0 when clicked.</p> <p>Possibly related: can I style the look of the hover / selection? Eg. to replace the blue gradient hover look (line 3) with a custom solid color. I have found <a href="https://stackoverflow.com/questions/382006/wpf-listview-inactive-selection-color">this</a> and <a href="http://blogs.msdn.com/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx" rel="noreferrer">this</a>, unfortunately not helping.</p> <p>(Achieving the same without using ListView is acceptable too. I'd just like to be able to use logical scrolling and UI virtualization as ListView does)</p> <p>The XAML for ListView is:</p> <pre><code>&lt;ListView Height="280" Name="listView"&gt; &lt;ListView.Resources&gt; &lt;!-- attempt to override selection color --&gt; &lt;SolidColorBrush x:Key="{x:Static SystemColors.HighlightColorKey}" Color="Green" /&gt; &lt;/ListView.Resources&gt; &lt;ListView.View&gt; &lt;GridView&gt; &lt;GridView.Columns&gt; &lt;GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}" /&gt; &lt;!-- more columns --&gt; &lt;/GridView.Columns&gt; &lt;/GridView&gt; &lt;/ListView.View&gt; &lt;/ListView&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload