469,898 Members | 1,408 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Retrieveing values from a listview

Eva
hi,

can anyone tell me how i can retrieve specific values from
a listview?

i have created 6 columns that will contain values that are
added on an onclick event for a button. These values are
ontained from the user via textboxes, comboboxes etc.
Jul 21 '05 #1
3 2466
In VB.NET:
ListView1.SelectedItems(0).SubItems(0).Text

In C#
ListView1.SelectedItems[0].SubItems[0].Text

In Cobol.NET
;-) Just kidding!

Is this what you are looking for?

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Eva" <us@t> schreef in bericht
news:01****************************@phx.gbl...
hi,

can anyone tell me how i can retrieve specific values from
a listview?

i have created 6 columns that will contain values that are
added on an onclick event for a button. These values are
ontained from the user via textboxes, comboboxes etc.

Jul 21 '05 #2
eva
Hi Jan,
will this return the entire row or just an individual item
in the listview.
what i want is to be able to select each one individually.
am i better off using a datagrid for this or is it just as
easy in a listview?

thx.
-----Original Message-----
In VB.NET:
ListView1.SelectedItems(0).SubItems(0).Text

In C#
ListView1.SelectedItems[0].SubItems[0].Text

In Cobol.NET
;-) Just kidding!

Is this what you are looking for?

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Eva" <us@t> schreef in bericht
news:01****************************@phx.gbl...
hi,

can anyone tell me how i can retrieve specific values from a listview?

i have created 6 columns that will contain values that are added on an onclick event for a button. These values are
ontained from the user via textboxes, comboboxes etc.

.

Jul 21 '05 #3
ListView1.SelectedItems[0] will return the entire row.
ListView1.SelectedItems[0].SubItems[0].Text will return the value of the
first column.

The advantage of a DataGrid is that you can bind directly to your data
objects, in a ListView you have to create ListViewItems and add them to the
list.

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"eva" <an*******@discussions.microsoft.com> schreef in bericht
news:02****************************@phx.gbl...
Hi Jan,
will this return the entire row or just an individual item
in the listview.
what i want is to be able to select each one individually.
am i better off using a datagrid for this or is it just as
easy in a listview?

thx.
-----Original Message-----
In VB.NET:
ListView1.SelectedItems(0).SubItems(0).Text

In C#
ListView1.SelectedItems[0].SubItems[0].Text

In Cobol.NET
;-) Just kidding!

Is this what you are looking for?

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Eva" <us@t> schreef in bericht
news:01****************************@phx.gbl...
hi,

can anyone tell me how i can retrieve specific values from a listview?

i have created 6 columns that will contain values that are added on an onclick event for a button. These values are
ontained from the user via textboxes, comboboxes etc.

.

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jonesgj | last post: by
3 posts views Thread by Eva | last post: by
2 posts views Thread by jediknight | last post: by
6 posts views Thread by Michael.Suarez | last post: by
5 posts views Thread by = poster = | last post: by
2 posts views Thread by =?Utf-8?B?UGhpbGlw?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.