How to implement CEditListCtrl?. List control with edit capabality (Report/Grid view). I have a list view in Report View. It has some values. I need to extend this to edit the values present in the list view. I declared a class which inherits from CListCtrl. And I have handled the two Window messages to start and end the edit. Upon getting the messages I am displaying a Text box. But I am not getting the control inside these message handlers. Is there a way to know the reason?
Or Is there a other way to implement this.
-
You need to use a CComboBox which is basically a combined CEdit and CListCtrl
Vinay : But I am displaying a tree structure inside this list view. I think it is not possible with CComboBoxShane MacLaughlin : Ok, my mistake. Have you tried using CListCtrl::GetEditControl to get a CEdit that you can use for editing. -
There are some neat grid controls on Code Project which might help:
http://www.codeproject.com/KB/miscctrl/gridctrl.aspx
-
Hi all, Thanks for all answers
I have done it easily.
- I have handled the WM_LBUTTONDOWN. This handler pops up the edit box to get the new value for the field
- Handled LVN_ENDLABELEDIT to know the end of update.
- After receiving the above message, updated the values.
“One thing I forgotten was to set the flag in the resource view for CListCtrl (Edit Labels to TRUE)”
We have to implement OnPaint() (in CListCtrl's derived class) also otherwise the UI won't update properly
-
This question was also asked here:
http://stackoverflow.com/questions/253919/how-to-edit-columns-in-place-with-clistctrl#257598
You can read my answer on that page.
0 comments:
Post a Comment