[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1117
  • Last Modified:

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.
0
narayanan_mahalingam
Asked:
narayanan_mahalingam
  • 2
1 Solution
 
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
 
Gautham JanardhanCommented:
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
 
narayanan_mahalingamAuthor Commented:
The response to the question came after a long time I posted the question.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now