473,387 Members | 1,574 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.

How can I execute a Sub with the value/text of every checked item inthe ListView?

Good day!

I was wondering if someone could show me the way with this little
problem I have.

I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.

The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)

I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:

Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text

I also can get the number of checked items using this:

Me.lvwExpense.CheckedItems.Count.ToString

The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?

Thanks in advance!

Regards,
iDesmet
Oct 31 '08 #1
6 1565
This is one possibility:

For Each lvi as ListViewItem In lvwItems.CheckedItems
Dim ItemX as ListViewItem.ListViewSubItemCollection=
lvi.SubItems
InsertSelItem(ctype(ItemX.Item(1).Text, Integer))
Next

"iDesmet" <id**********@gmail.comwrote in message
news:ef**********************************@i24g2000 prf.googlegroups.com...
Good day!

I was wondering if someone could show me the way with this little
problem I have.

I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.

The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)

I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:

Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text

I also can get the number of checked items using this:

Me.lvwExpense.CheckedItems.Count.ToString

The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?

Thanks in advance!

Regards,
iDesmet
Nov 1 '08 #2
This is one possibility:

For Each lvi as ListViewItem In lvwItems.CheckedItems
Dim ItemX as ListViewItem.ListViewSubItemCollection=
lvi.SubItems
InsertSelItem(ctype(ItemX.Item(1).Text, Integer))
Next

"iDesmet" <id**********@gmail.comwrote in message
news:ef**********************************@i24g2000 prf.googlegroups.com...
Good day!

I was wondering if someone could show me the way with this little
problem I have.

I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.

The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)

I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:

Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text

I also can get the number of checked items using this:

Me.lvwExpense.CheckedItems.Count.ToString

The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?

Thanks in advance!

Regards,
iDesmet
Nov 1 '08 #3
This is one possibility:

For Each lvi as ListViewItem In lvwItems.CheckedItems
Dim ItemX as ListViewItem.ListViewSubItemCollection=
lvi.SubItems
InsertSelItem(ctype(ItemX.Item(1).Text, Integer))
Next

"iDesmet" <id**********@gmail.comwrote in message
news:ef**********************************@i24g2000 prf.googlegroups.com...
Good day!

I was wondering if someone could show me the way with this little
problem I have.

I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.

The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)

I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:

Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text

I also can get the number of checked items using this:

Me.lvwExpense.CheckedItems.Count.ToString

The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?

Thanks in advance!

Regards,
iDesmet
Nov 1 '08 #4
This is one possibility:

For Each lvi as ListViewItem In lvwItems.CheckedItems
Dim ItemX as ListViewItem.ListViewSubItemCollection=
lvi.SubItems
InsertSelItem(ctype(ItemX.Item(1).Text, Integer))
Next

"iDesmet" <id**********@gmail.comwrote in message
news:ef**********************************@i24g2000 prf.googlegroups.com...
Good day!

I was wondering if someone could show me the way with this little
problem I have.

I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.

The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)

I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:

Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text

I also can get the number of checked items using this:

Me.lvwExpense.CheckedItems.Count.ToString

The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?

Thanks in advance!

Regards,
iDesmet
Nov 1 '08 #5
This is one possibility:

For Each lvi as ListViewItem In lvwItems.CheckedItems
Dim ItemX as ListViewItem.ListViewSubItemCollection=
lvi.SubItems
InsertSelItem(ctype(ItemX.Item(1).Text, Integer))
Next

"iDesmet" <id**********@gmail.comwrote in message
news:ef**********************************@i24g2000 prf.googlegroups.com...
Good day!

I was wondering if someone could show me the way with this little
problem I have.

I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.

The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)

I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:

Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text

I also can get the number of checked items using this:

Me.lvwExpense.CheckedItems.Count.ToString

The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?

Thanks in advance!

Regards,
iDesmet
Nov 1 '08 #6
On Nov 1, 3:29*am, "James Hahn" <jh...@yahoo.comwrote:
This is one possibility:

* * * * * * For Each lvi as ListViewItem In lvwItems.CheckedItems
* * * * * * * * Dim ItemX as ListViewItem.ListViewSubItemCollection=
lvi.SubItems
* * * * * * * * InsertSelItem(ctype(ItemX.Item(1).Text, Integer))
* * * * * * Next

"iDesmet" <idesmet.w...@gmail.comwrote in message

news:ef**********************************@i24g2000 prf.googlegroups.com...
Good day!
I was wondering if someone could show me the way with this little
problem I have.
I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.
The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)
I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:
Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text
I also can get the number of checked items using this:
Me.lvwExpense.CheckedItems.Count.ToString
The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?
Thanks in advance!
Regards,
iDesmet
Thanks a lot!

It worked like a charm!

Regards,
iDesmet
Nov 18 '08 #7

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

Similar topics

16
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not...
2
by: David | last post by:
Hello. In listview I have 3 collumns. How can I read text from 2rd ITEM - 2nd Subitem Example: Mark PEter June HEllo By All Sony Philips Panasonic This is listview:
4
by: gugu | last post by:
Hi I have a datagrid which has 20 rows and 20 columns, 15 of 20 columns are checkboxs and their headertexts, datafields are dynamic. I need to loop through the whole page to see if the specific...
2
by: Tim.Geiges | last post by:
This seems like ti should be very simple but I am sort of a newb and this one is killing me I am just trying to copy all the items that are checked in listView2 over to listView1 when a button is...
5
by: John Devlon | last post by:
Hi, Does anyone know how to get a value of a second column of a selected item in Listview. I've create a listview and added this code Listview.Items.Clear() Listview.Columns.Clear()...
1
by: marcyb | last post by:
I need this to charge sales tax on if oklahoma resident is checked <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
3
by: sherifffruitfly | last post by:
Hi, Here's a skeleton-handler of what I'm trying to do: private void editBbListView_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e) { string qEnabled = ""; string...
7
by: Pantokrator | last post by:
Hi, I've searched the web and MSDN but couldn't find adequate information on retrieving the text of a subitem of a listviewitem. What I want to do is simple. I have a listview control with 2...
7
by: Brad Pears | last post by:
I have something strange going on - pretty sure it used to work before - and now it does not... Why does the following code not clear a combo box? Me.cboLocation.Text = String.Empty OR ...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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.