Solved

Select ListView Row WPF

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now