473,761 Members | 5,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(B yVal 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.Che ckedItems.Item( 0).SubItems(1). Text

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

Me.lvwExpense.C heckedItems.Cou nt.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 1592
This is one possibility:

For Each lvi as ListViewItem In lvwItems.Checke dItems
Dim ItemX as ListViewItem.Li stViewSubItemCo llection=
lvi.SubItems
InsertSelItem(c type(ItemX.Item (1).Text, Integer))
Next

"iDesmet" <id**********@g mail.comwrote in message
news:ef******** *************** ***********@i24 g2000prf.google groups.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(B yVal 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.Che ckedItems.Item( 0).SubItems(1). Text

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

Me.lvwExpense.C heckedItems.Cou nt.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.Checke dItems
Dim ItemX as ListViewItem.Li stViewSubItemCo llection=
lvi.SubItems
InsertSelItem(c type(ItemX.Item (1).Text, Integer))
Next

"iDesmet" <id**********@g mail.comwrote in message
news:ef******** *************** ***********@i24 g2000prf.google groups.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(B yVal 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.Che ckedItems.Item( 0).SubItems(1). Text

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

Me.lvwExpense.C heckedItems.Cou nt.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.Checke dItems
Dim ItemX as ListViewItem.Li stViewSubItemCo llection=
lvi.SubItems
InsertSelItem(c type(ItemX.Item (1).Text, Integer))
Next

"iDesmet" <id**********@g mail.comwrote in message
news:ef******** *************** ***********@i24 g2000prf.google groups.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(B yVal 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.Che ckedItems.Item( 0).SubItems(1). Text

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

Me.lvwExpense.C heckedItems.Cou nt.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.Checke dItems
Dim ItemX as ListViewItem.Li stViewSubItemCo llection=
lvi.SubItems
InsertSelItem(c type(ItemX.Item (1).Text, Integer))
Next

"iDesmet" <id**********@g mail.comwrote in message
news:ef******** *************** ***********@i24 g2000prf.google groups.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(B yVal 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.Che ckedItems.Item( 0).SubItems(1). Text

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

Me.lvwExpense.C heckedItems.Cou nt.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.Checke dItems
Dim ItemX as ListViewItem.Li stViewSubItemCo llection=
lvi.SubItems
InsertSelItem(c type(ItemX.Item (1).Text, Integer))
Next

"iDesmet" <id**********@g mail.comwrote in message
news:ef******** *************** ***********@i24 g2000prf.google groups.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(B yVal 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.Che ckedItems.Item( 0).SubItems(1). Text

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

Me.lvwExpense.C heckedItems.Cou nt.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.co mwrote:
This is one possibility:

* * * * * * For Each lvi as ListViewItem In lvwItems.Checke dItems
* * * * * * * * Dim ItemX as ListViewItem.Li stViewSubItemCo llection=
lvi.SubItems
* * * * * * * * InsertSelItem(c type(ItemX.Item (1).Text, Integer))
* * * * * * Next

"iDesmet" <idesmet.w...@g mail.comwrote in message

news:ef******** *************** ***********@i24 g2000prf.google groups.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(B yVal 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.Che ckedItems.Item( 0).SubItems(1). Text
I also can get the number of checked items using this:
Me.lvwExpense.C heckedItems.Cou nt.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
11501
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 an object... the function is like so: function calc_total() { var x,i,base,margin,total,newmargin,newtotal; base = document.frmKitAmount.txtTotalKitValue.value; margin = document.frmKitAmount.margin.value/100;
2
1252
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
908
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 check box cell is checked or not. The code is as follows: For rowindex = 0 To myDataGrid.Items.Count - 1 Dim item As DataGridItem = myDataGrid.Items.Item(rowindex) For colindex = 0 To myDataGrid.Columns.Count - 1
2
2496
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 clicked. can anyone give me an example please? Thank you for your time, Tim
5
25963
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() Listview.View = View.Details
1
2990
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
3
2320
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 indexid = ITEM_IN_ROW_WHOSE_CHECK_JUST_CHANGED.Text;
7
7348
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 columns and a large number of listviewitems. Every time I click on a row (one of the listviewitems), I would like to get the String* representation of the second column cell. First I get the index as follows:
7
3582
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 Me.cboLocation.Text = ""
0
9554
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9377
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8814
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3913
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
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.