Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi,

I am having a listcontrol where i populated it with some values with 2 rows and 4 columns .
When i added LVS_EX_CHECKBOXES it is adding checkboxes to one column only ,my question is how can i add checkboxes to the sub item's too.

This how i had done:

column1-------column2-------column3------column4
[]Item1 -------SubItem1------SubItem2-----SubItem3
[]Item2 --------SubItem1------SubItem2-----SubItem3


[]-Checkbox got enabled

What i have to do is:

column1-------column2-------column3------column4
[]Item1 -------SubItem1---[]SubItem2---[]SubItem3
[]Item2 ------[]SubItem1---[]SubItem2-----SubItem3


As i mentioned in the above the few subitems should have checkbox.

Can Anyone please help me :)

Thanks In Advance.
Posted

You can't; the ListView control only adds checkboxes to the main item (i.e. column 1) not to the subitems. See Adding Checkboxes to a list control[^] for more information.
 
Share this answer
 
Comments
RajaPratap 5-Jun-14 5:12am    
Don't we have any other way to achieve that,because i have to add the check box to the subitem's and i retrieve the checked state of those subitems and need to perform some operation .Please let me know if any other possibly way is there to attain that.

Thanks in Advance.
You could have a look at one (or more) of the many ListView customizations available here at Code Project. See, for instance: "XListCtrl - A custom-draw list control with subitem formatting"[^].
 
Share this answer
 
Comments
RajaPratap 6-Jun-14 0:52am    
Can you please elaborate how to use this XListCtrl .Should I link up the binaries of XListCtrl to my project.

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