473,325 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

ListView Properties

103 100+
Hi all,

I am trying to retrieve values from a ListView. I can find in some sites that

ListView1.SelectedItems[0].SubItems[0].Text is the code for retrieving first value from a ListView. But "SelectedItems" property is not available. I am using VS2008. c#.net. Any other namespace i have to add? I added "System.Web.UI.WebControls" namespace.

Please Help me..

Thanks and Regards,

Mathew
Sep 23 '08 #1
3 1290
Curtis Rutland
3,256 Expert 2GB
Well, there is .SelectedIndex and .SelectedValue. Hopefully those will help do what you need.
Sep 23 '08 #2
mathewgk80
103 100+
Well, there is .SelectedIndex and .SelectedValue. Hopefully those will help do what you need.
Thanks... Can you help me to retrieve second item in the first row of a ListView.

Thanks in Advance,

Mathew.
Sep 23 '08 #3
Curtis Rutland
3,256 Expert 2GB
Thanks... Can you help me to retrieve second item in the first row of a ListView.

Thanks in Advance,

Mathew.
I don't think that it works that way. Look into the Item array, you'll see that it is a List of type ListViewDataItem. There is no sub array. But ListViews have to be bound to a datasource, so why don't you get the value you're looking from from the datasource?
Sep 23 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: andrewcw | last post by:
I have a simple winform with the following code. But although I can read back the info, the display fails to provide the text or the cell background color changes. private void ListViewBroke()...
1
by: newbie | last post by:
Hello, I maybe asking too much in a single posting, but here it goes: I building a windows form that mimic's the Outlook XP GUI. Its a three pane form that will allow a user to view and edit...
7
by: Dave Y | last post by:
I am a newbie to C# and am having trouble trying to override a ListView property method. I have created a new class derived from the Forms.Listview and I cannot figure out the syntax to override...
1
by: Riccardo Giomi | last post by:
Hi I would to display a Cursors.WaitCursor on a ListView control, so I tried listView.Cursor = Cursors.WaitCursor but it doesn't work at all, I see always the default cursor. The same thing...
3
by: MikeY | last post by:
Hopefully someone can help me on this. I am using C#, making Windows forms. I have created a listView with checkbox's. I have enabled the checkboxes under the properties, and all the data,...
3
by: OpticTygre | last post by:
Are there any good tutorials out on the net that explains the listview control with great detail? Things like drag-drop features, icon additions, etc...?
7
by: BobAchgill | last post by:
I am trying to decide which of these controls to use to implement letting my user select a full row from MyList. The MyList has several columns which would be nice to sort by at run time. The...
6
by: Josef Brunner | last post by:
Hi, I have a problem using two ListView controls on one and the same form: Problem: The second ListView is never focused. No matter where I "click" non of the items within the ListView is...
12
by: garyusenet | last post by:
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. ...
4
by: Bill-R | last post by:
I'm trying to convert a vb6 program to vb.net (vb2008 express) I have text data in a Listview Control I use a Textbox to enter characters to search the Listview When a Match is found, I use...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.