473,563 Members | 2,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1307
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.EventArg s) Handles CheckBox1.Click
Select Case Me.CheckBox1.Ch ecked
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.EventArg s) Handles CheckBox1.Click
Select Case Me.CheckBox1.Ch ecked
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
2616
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 am populating listview with more than 200,000 items. It is too slow and tried virtual listview. But that doesnot allow me to add images in the...
0
489
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 am populating listview with more than 200,000 items. It is too slow and tried virtual listview. But that doesnot allow me to add images in the...
0
2215
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 ("Col1",200,HorizontalAlignment.Left); listview.Columns.Add ("Col2",800,HorizontalAlignment.Left);
7
6426
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 ListView.Items.Add(), . I see that it is a virtual method so it should be easy to do. If anyone can help I would appreciate it greatly. I can do what...
7
14964
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 MyList data is resident in a dataset table. I'm stuck and can't choose either because. If I choose ListView as my control I don't understand how...
1
1315
by: ibnsahl_mail | last post by:
Do you want really to know the happiness road ? Visit : www.sultan.org
2
6816
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 form every thing works fine: checking items by code
4
4489
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 is that when clicking on the "Show details" button the ListView for the appropriate row binds in the codebehind and displays the detail data for the...
0
7659
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...
0
7580
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...
0
8103
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6244
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...
1
5481
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5208
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3634
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.