Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Select ListView Row WPF

Posted on 2010-09-08
4
Medium Priority
?
1,110 Views
Last Modified: 2013-11-12
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
Comment
Question by:narayanan_mahalingam
  • 2
4 Comments
 
LVL 4

Expert Comment

by:codenhack
ID: 33629905
You could use SelectedIndex at any event you want

this.listBox.SelectedIndex = 2;
 
 
0
 

Author Comment

by:narayanan_mahalingam
ID: 33634869
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
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 750 total points
ID: 33704317
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
 

Author Closing Comment

by:narayanan_mahalingam
ID: 33706987
The response to the question came after a long time I posted the question.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question