Select ListView Row WPF

I need a help on WPF ListView. I want to programmatically select a WPF listview row and have the row highlighted the way the listview row gets highlighted when I click the row.
narayanan_mahalingamAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Gautham JanardhanConnect With a Mentor Commented:
you don't have to do anything for that.. Looks like your control don't have focus..

this.listBox.SelectedIndex = 2;
this.listBox.Focus();
0
 
codenhackCommented:
You could use SelectedIndex at any event you want

this.listBox.SelectedIndex = 2;
 
 
0
 
narayanan_mahalingamAuthor Commented:
It is selecting the row, but how do I get the same visual effect as happens when I click a row on the listview.
0
 
narayanan_mahalingamAuthor Commented:
The response to the question came after a long time I posted the question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.