943,720 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 4676
  • C++ RSS
Jun 12th, 2008
0

selecting entire row in CListCtrl

Expand Post »
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
Reputation Points: 66
Solved Threads: 11
Junior Poster
kux is offline Offline
119 posts
since Jan 2008
Jun 12th, 2008
0

Re: selecting entire row in CListCtrl

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,950 posts
since Aug 2005
Jun 13th, 2008
0

Re: selecting entire row in CListCtrl

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.

C++ Syntax (Toggle Plain Text)
  1. 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
Reputation Points: 10
Solved Threads: 4
Newbie Poster
Rajith Cherian is offline Offline
22 posts
since Dec 2007
Jun 13th, 2008
0

Re: selecting entire row in CListCtrl

I acknowledge the answer given my Mr.Rajith.

For full row select , the style LVS_EX_FULLROWSELECT will do
Reputation Points: 11
Solved Threads: 5
Newbie Poster
Aashath is offline Offline
18 posts
since Dec 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Using CreateThread() function
Next Thread in C++ Forum Timeline: Win32 DialogBox





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC