473,395 Members | 1,863 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,395 software developers and data experts.

ListView Happiness

I am working with a program that utilized the checkbox property of a
listview. When a user clicked on the checkbox, it was suppose to
calculate and total some prices. I did not make any changes to the
listview, but now the method does not work when the checkbox is
clicked.

In trying to fix this problem, it would seem that when I click on the
checkbox it calls the itemcheck event. In the itemcheck event I check
to see if the state of the checkbox is True or False. I believe that it
only reads the checkbox as being checked, not as being populated with a
checkmark.

When I step through the method, after clicking a checkbox, it still
shows it false. If I click it again and step through the method it
shows it as true. Also if there is more then one item in the listview,
If one of the items is clicked, it shows the state of the checkbox as
false. If both of the items are clicked then it shows the state of the
checkbox as true.

If anyone has run into the problem before, I would appreciate any help.
If have not been clear enough with my problem, please let me know.

Appreciate any help.

Scott Moore

Oct 18 '06 #1
2 1296
This happens when you use the checkbox, I would use the click event.

Private Sub CheckBox1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles CheckBox1.Click
Select Case Me.CheckBox1.Checked
Case True
'Do something
Case False
'Do something else
End Select
End Sub
Oct 19 '06 #2
The CheckBox in a ListView does not have a click event. It has an
ItemCheck event that I was able to use. A colleague at my work found a
link on MSDN that helped me greatly. I have posted it below in the case
someone else needs help with this situation. I do not want anyone else
to go through fun and enjoyment that is a ListView CheckBox like I did.
http://msdn2.microsoft.com/en-us/lib...ckeditems.aspx

Scott

ma*****@verizon.net wrote:
This happens when you use the checkbox, I would use the click event.

Private Sub CheckBox1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles CheckBox1.Click
Select Case Me.CheckBox1.Checked
Case True
'Do something
Case False
'Do something else
End Select
End Sub
Oct 19 '06 #3

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

Similar topics

6
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: keith | last post by:
In a ListView control (two columns), I added a few ListView items. ListView listview=new ListView(); listview.Parent=this; listview.View=View.Details; listview.Columns.Add...
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...
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...
1
by: ibnsahl_mail | last post by:
Do you want really to know the happiness road ? Visit : www.sultan.org
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.