473,387 Members | 3,787 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,387 software developers and data experts.

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 2573
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Brian Henry | last post by:
is there a way to tell when the database connection is retrieveing data? i saw the connectionstate.fetching enumerated value, but of course it's not implemented yet... is there another way to do...
1
by: Jonesgj | last post by:
Hi, First time I am using this control in lieu of a listbox, and I want to be able to get values and row positions back ... I seem to be able to get the first col value back using focusitem, but...
3
by: Eva | last post by:
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...
2
by: jediknight | last post by:
Hi, I have a listview which has columns of text and columns of numerical data. I need to be able to sort these columns into ascending/desending order whenever the user clicks on the column...
6
by: Michael.Suarez | last post by:
Consider the TextBox Control. It has a KeyPress event of type KeyPressEventHandler which passes a KeyPressEventArgs to whatever method is assigned to the event. When you set e.Handled = false...
5
by: = poster = | last post by:
Hi all , I have the following problem : $some_query = mysql_query( "SELECT table1.id, table1.category, table1.author, table1.title, table2.title, table2.category FROM table1, table2 WHERE...
1
by: svsenthilkumar | last post by:
how can i add 10 days with retrieveing date using php i retrieve a date from mysql table,and i add 10 days with that date and compare with today is or not.
2
by: =?Utf-8?B?UGhpbGlw?= | last post by:
I am attempting to insert a simple record with LinqDataSource from a ListView, however I always get a message saying "....LinqDataSource 'dataSource' has no values to insert. Check that the...
0
by: mesut | last post by:
Hi colleagues, I've a very strange problem here. I have no clue whyt it happens. I have a listview. The Listview populates well. I have an Update Button in the listview and a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.