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

WPF Prevent an item being selectect in combobox when hovered

$
0
0

One of our QA noticed this combobox behavior that if they hover on the combobox items, it get selected. What they are expecting is this should not happen and it should only be selected when clicked.

To reproduce this problem. here's a simple XAML

<Grid><Grid.DataContext><local:CBItems/></Grid.DataContext><StackPanel VerticalAlignment="Center"><ComboBox IsEditable="True" ItemsSource="{Binding Items}" /></StackPanel></Grid>

and here's the test class

public class CBItems
{
	List<string> t = new List<string>()
	{"item 1","item 2","item 3","item 4","item 5"
	};

	public List<string> Items
	{
		get { return t; }
	}

	public CBItems()
	{
	}
}

here's my screencast video for demo http://screencast.com/t/w6UZNCfptc take note that I am not clicking on the items.. I just hover it and pressed Enter key.

How do I get rid of that behvior?

Thanks!




Viewing all articles
Browse latest Browse all 18858

Trending Articles



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