Detect when ListViewSubItem.Text changes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know that setting ListView.LabelEdit = True allows the user to edit the Text property of the "item" ListViewSubItem for each ListViewItem in the control. But, is there any way to detect when the ListViewSubItem.Text changes? I've tried inheriting from ListViewSubItem and shadowing the Text property in order to raise my own event, but this did not work (presumably because the shadowed property of the inherited class is never used by the ListView)

Thanks for any help
Lance
 
Hi zippy,

Based on my understanding, you want to be notified when the ListViewSubItem
text is changed.

First, I want to remind you that LabelEdit=true can only enable the edit
for the ListViewItem, the ListViewSubItem can not be edited. (This is
documented in MSDN: ListView.LabelEdit property, please refer to it.)

If you want to be notified when the ListViewItem is changed, you may refer
to ListView.AfterLabelEdit event. In this event, you can determine the
changing text through LabelEditEventArgs argument. Then if you want to
cancel the update, you may set LabelEditEventArgs.CancelEdit =true.

Also, you may use ListView.BeforeLabelEdit event to do some pre-validation
for the ListViewItem.

Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi zippy

If you have any further concern, please feel free to feedback, I will work
with you. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top