Solved

Select ListView Row WPF

Posted on 2010-09-08
4
1,036 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 250 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RIA: CancelEdit() doesn't change entity back to Unchanged status 5 43
dialer.exe 4 68
Using MS Code on my Mac 6 72
Licensing Sharepoint 2016 for developers 11 76
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…

749 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