473,568 Members | 2,923 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Selecting Items in ListView

Dear All,

Could anyone shed some light on a method which returns the 'index' of a
selected item in a listview control, set to 'list' only.

Is this possible?

Thanks

Greg
Nov 16 '05 #1
2 1198

try listView1.Selec tedIndex for a single selection view...
"Greg Horwood" <Gr*********@di scussions.micro soft.com> wrote in message
news:8C******** *************** ***********@mic rosoft.com...
Dear All,

Could anyone shed some light on a method which returns the 'index' of a
selected item in a listview control, set to 'list' only.

Is this possible?

Thanks

Greg

Nov 16 '05 #2
Thanks Dan. will give it a go.

"Dan Bass" wrote:

try listView1.Selec tedIndex for a single selection view...
"Greg Horwood" <Gr*********@di scussions.micro soft.com> wrote in message
news:8C******** *************** ***********@mic rosoft.com...
Dear All,

Could anyone shed some light on a method which returns the 'index' of a
selected item in a listview control, set to 'list' only.

Is this possible?

Thanks

Greg


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5187
by: vince | last post by:
I need to programmatically select the first item in a listview before the listview is displayed, so far I'm not having any luck. Here's what I tried in the init for the listview... LoadListView(); listView4.Items.Selected = true; Also tried to invalidate and get a redraw, didn't make a difference...
1
2046
by: Sean Chapman | last post by:
I was wondering how I would go about programmincally selecting a listView item in a listView since the Selected val is read-only. I can't seem to find any other method that will do this for me. I'm using a listView to list some items and want to be able to delete one, then have it select the next one in the list automatically.
1
3396
by: Bob Geltz | last post by:
I am able to populate a ListView with several detail lines (several columns). When finished, I would like to pre-select the first item in the list (before the user interacts with the list). This way, if a user clicks on the OK button, there will be a default selection. I know how to use ListView.SelectedItems to get the selection, I just...
4
9701
by: Paddy | last post by:
How do I select a subitem from a listview after clicking on the first column? Couldn't find it in MSDN. Thank you. Paddy.
2
2986
by: David Anderson | last post by:
I'm working on a Windows app that has a ListView containing a bunch of items. When the user clicks on an item, the app displays the item'd details. The user then has the opportunity to edit these details. The user should click the Save button after each change, but of course that doesn't always happen. If the user makes changes and doesn't...
10
11320
by: Danny Tuppeny | last post by:
Hi All, I'm trying to find the best way to select an item in a ListView using the Virtual mode. My "items" are business classes, and I have a reference to once I want to select (passed from another dialog). One way is to spin through the items and compare the .Tag property to my business object (code below), however I fear the casts are...
3
15694
by: Bry | last post by:
I know you can select a single item in a list view using the following code listView.Items.Selected = true; Is it possible to do this for all items in the listView control without using a loop? Thanks.
4
6079
by: Mark Rae | last post by:
Hi, I have a bog-standard ListView control in a v1.1 C# WinForms project, with three colums, Details View. There is "Select All" button under the ListView control with the following code: foreach(ListViewItem lvi in lvBackupFiles.Items) {
4
2076
by: Duncan Smith | last post by:
So far, the quikest way I have found to select all items in a list box is to turn off updates, set a wait cusror and then call SetSelected on each item (see below), but it's too slow when the control is populated with tens of thousands of items. Ideally the wait-cursor shouldn't be needed as I hadn't anticipated a select-all operation...
1
2071
by: c35tar1 | last post by:
I have a ListView within a dialog. In code the groups are created and items added. Display is 100% correct. The problem is with using Shift to select multiple items in the list. - If you select the first item and then a second next to it, it reverses the selection - If you select the first item and then Shift to a few further down or...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.