Click here to Skip to main content
15,898,990 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I searched for solutions but they work for the entire column, I wanted to get it for a particular row

What I have tried:

I got solutions online they worked for the entire column
Posted
Updated 27-May-18 23:42pm
v4
Comments
Richard MacCutchan 27-May-18 7:07am    
You need to edit your question, show the code you have, and explain exactly what happens.

1 solution

The generic CListCtrl provides no support for columns with embedded controls. If you need those you have to create your own CListCtrl based class supporting that as provided by solutions you have probably found already.

But those are doing that column wise because that is the intention of such lists. If you want the controls for specific cells only, you have to extend those solutions. You have to create the embedded controls and store it's window handles or pointers in another list. You need also some kind of lookup function that returns those handles for a specific row and column. The list has to be custom draw (let the embedded control redraw itself instead of using the default list item drawing) and provide activation of the embedded controls (setting the focus) upon several mouse and keyboard events.

A simpler method might be using overlay controls. That is creating the controls dynamically when activating a specific cell (e.g. by double clicking or via context menu) and setting the focus to them. Once the edit / selection has been done, the list cell can be updated, the temporary control is deleted, and focus is returned back to the list. But with this method there will be no indication of cells that provide selection or edit.
 
Share this answer
 

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