Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Select ListView Row WPF

Posted on 2010-09-08
4
1,029 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 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