954,152 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

selecting entire row in CListCtrl

Hello,

I have a CListCtrl and a button to modify the selected row in the CListCtrl.
My problem is that my list has several columns and I want to be able to select a row by clicking on any column of the row that I want selected. Now I can only select a row by clicking on the value found on it's first column. I think it's something about the CListCtrl propertyes , but can't figure out what has to be set.

Thx in advnace

kux
Junior Poster
119 posts since Jan 2008
Reputation Points: 66
Solved Threads: 11
 

The solution is to find out what is the difference between clicking on the first column and clicking on the second column. In both cases I think your program should get the click event.

Ancient Dragon
Retired & Loving It
Team Colleague
30,042 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
 

Sorry Im not able to get your question.

1) Do you want to select an entire column by clicking on a cell???
2) Or do you want to select the entire row by clicking on a cell???

If your question is No:2 u need to set a style for the list control.

m_ListCtrl.SetExtendedStyle( m_ListCtrl.GetExtendedStyle() | LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT )


If your question is No:1 then u need to seperately handle it. There is no styles for that

Rajith Cherian
Newbie Poster
23 posts since Dec 2007
Reputation Points: 10
Solved Threads: 4
 

I acknowledge the answer given my Mr.Rajith.

For full row select , the style LVS_EX_FULLROWSELECT will do

Aashath
Newbie Poster
18 posts since Dec 2007
Reputation Points: 11
Solved Threads: 5
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You