I have a ListView control with TextBox and Button inside the ListViewItem, my problem is that when you enter into a textbox the row doesn't select. If you want to select a row you have to click somewhere in the row where there is no control.
How can I make the row automaticly select when I click or enter into a child control of a row ?
I tried this on the button click event, but without any luck :
DependencyObject dep = (DependencyObject)sender;
while ((dep != null) && !(dep is ListViewItem))
{
dep = VisualTreeHelper.GetParent(dep);
}
if (dep != null)
{
lvRoutes.SelectedItem = (ListViewItem)dep;
}
It always keep the first row selected.
Thank in advance.