Sign in to follow this  

Item editing in list views [Win32]

This topic is 4278 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Do list views support item editing? I know Explorer uses list views for displaying directories, and you can edit the first column. So is there a way to enable this? Or do I have to implement my own cell editing mechanism?

Share this post


Link to post
Share on other sites
You have to do it yourself. It is pretty easy though. On your edit start event (doubleclick, F2) you check the current item (plus subitem) and place an edit control there. If you're not using MFC you may need to subclass the edit's winproc to catch a few special keys like enter or escape to stop editing. Everything else ought to be managed by catching the EN_x-messages.

You also may want to disable the listview while the edit is opened to disable scrolling (with mousewheel).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Editing of a listview item's label, i.e., the first column's text, is easily done through the handling of the built-in listview WM_NOTIFY notification msgs, namely LVN_BEGINLABELEDIT and LVN_ENDLABELEDIT. this will get you the equivalent of what Explorer does.

Share this post


Link to post
Share on other sites

This topic is 4278 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this