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

Tri state listview

I'm working with a subclassed listview control and I'd like to have the
ability to set the checkbox on a certain item to indeterminate. I've
tried adding three images to the stateimagelist (unchecked, checked,
and indeterminate), but setting the checkstate in the ItemCheck event
doesn't seem to do the trick. Actually, whenever I click on the
checkbox it seems to cycle through the images in the stateimagelist.

Also, once this item is set to indeterminate I'd like to lock it down
so that it's state cannot be changed. Any help on this matter would be
greatly appreciated

Nov 17 '05 #1
1 2928
Hi,
I'm working with a subclassed listview control and I'd like to have the
ability to set the checkbox on a certain item to indeterminate. I've
tried adding three images to the stateimagelist (unchecked, checked,
and indeterminate), but setting the checkstate in the ItemCheck event
doesn't seem to do the trick. Actually, whenever I click on the
checkbox it seems to cycle through the images in the stateimagelist.

Also, once this item is set to indeterminate I'd like to lock it down
so that it's state cannot be changed. Any help on this matter would be
greatly appreciated


If you're not using icons (images) in a listView then i've got simple
solution for you:
1) prepare images: checked (0), unchecked(1), indeterminate (2)
2) disable checkBoxes in your listView
3) fill your listView.Items with wanted "ImageIndex" settings
4) "CheckedIndices" you've got to write yourself.

Elswere if you need images you can "imitate" the indeterminate
state by listViewItem.BackColor (e.g. SystemColors.Control)

HTH
Marcin
Nov 17 '05 #2

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...
2
by: lea | last post by:
i create few textboxes, if i enter data in txtItemCode, the rest txtbo will display data that read from database. show below. ========================================================== Private Su...
6
by: VM | last post by:
How can I fill up a listview with text file contents? My listview has two columns and the first column fills up with a while loop: while (myString != null) { myString = sr.Readline();...
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...
1
by: Steve | last post by:
I have a listview that can get itself into a situation where multiple items have the LVIS_FOCUSED state. According to the documentation, LVIS_FOCUSED means "The item has the focus, so it is...
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...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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,...
0
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...
0
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...

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.