selecting entire row in CListCtrl

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jan 2008
Posts: 119
Reputation: kux is on a distinguished road 
Solved Threads: 10
kux kux is offline Offline
Junior Poster

selecting entire row in CListCtrl

 
0
  #1
Jun 12th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,442
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1474
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: selecting entire row in CListCtrl

 
0
  #2
Jun 12th, 2008
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 22
Reputation: Rajith Cherian is an unknown quantity at this point 
Solved Threads: 4
Rajith Cherian's Avatar
Rajith Cherian Rajith Cherian is offline Offline
Newbie Poster

Re: selecting entire row in CListCtrl

 
0
  #3
Jun 13th, 2008
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.

  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
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 18
Reputation: Aashath is an unknown quantity at this point 
Solved Threads: 5
Aashath's Avatar
Aashath Aashath is offline Offline
Newbie Poster

Re: selecting entire row in CListCtrl

 
0
  #4
Jun 13th, 2008
I acknowledge the answer given my Mr.Rajith.

For full row select , the style LVS_EX_FULLROWSELECT will do
"The most important single aspect of software development is to be clear about what you are trying to build." - Bjarne Stroustrup
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC