In one of my projects, I needed to add a single cell (SubItem) selection in Report style list control. By default, List control has full row selection style that can be set using "LVS_EX_FULLROWSELECT
" as a flag in SetExtendedStyle()
.
To select a subitem in Report style list control, you have to set LVS_OWNERDRAWFIXED
style and have to implement DrawItem()
function in your CListCtrl
derived class.
Following is the implementation of DrawItem
function that shows selection around a subitem in report style list control.