Click here to Skip to main content
15,894,539 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to have the Checklist change "checked states" every time you click on an Item in the list (Not only when you click into the Check box itself)
This seems a straight forward task but somehow it's given me trouble - is not behaving properly
I have obviously tried "tons" of different approaches using different handels - below is what I currently been using

SQL
If CheckListDisplay.SelectedIndex <> -1 Then

        
If CheckListDisplay.GetItemCheckState(CheckListDisplay.SelectedIndex) = CheckState.Checked Then

                CheckListDisplay.SetItemCheckState(CheckListDisplay.SelectedIndex, CheckState.Unchecked)
            Else

                CheckListDisplay.SetItemCheckState(CheckListDisplay.SelectedIndex, CheckState.Checked)
            End If
        End If
        CheckListDisplay.Refresh()


It always seems to work properly with brakes but if you run it without brake it start miss behaving :-) = You have to click twice - will only do it the first time you click an item and so on

Obviously I'm missing something

any Ideas
Posted

1 solution

Have you set the CheckOnClick property to True, and this dispenses with the need to do anything else. Its been around since v1.1 so its not a new setting.
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900