In .NET framework, is it possible to set some of the items in the CheckedListBox as ‘uncheckable’ ? I don’t want to allow user to check the same items again and add them to a another existing list.
I hope I am clear. Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would set those items as ‘Indeterminate’ in code, and then overwrite the ‘NewValue’ property from the ItemCheck event when the user attempts to check/uncheck them:
The ‘Can’t check me’ item in the CheckedListBox can’t be modified, because every time the user tries to check/uncheck it, the event handler changes it back. You don’t even see the UI update accordingly.