-
ListView LabelEdit
Hello,
I have a ListView that "after" a label edit I need to add spaces to the beginning of the file name. My problem is that any code ran in the AfterLabelEdit event actually takes place before the ListViews own LabelEdit logic updates the text of the ListViewItem.
So...
1) User edits label
2) I assign the text
3) AfterLabelEdit changes the text back after the exiting the event from my side.
The only thing I can think of at this point is to set a timer at the end of the AfterLabelEdit event to set the text to what I want it. Seems like a pretty lame solution to me.
Any suggestions?
Thanks in advance,
Christian
-
Re: ListView LabelEdit
What if you perform the label edit manually or Override the listview events?
-
Re: ListView LabelEdit
Not sure what you mean by manually.
Haven't tried overriding the listview event. Don't I have to create my own inherited ListView object to do that? Or is there an easier way?
-
Re: ListView LabelEdit
Yes, you would have to inherit the listview.
Manually, I mean calling the .StartLabelEdit in code and not sure if it would be called modally, but if it is then you could call your update fix after on the next line of c0d.
-
Re: ListView LabelEdit
Yea,
I do call it manually:
ListViewItem.BeginEdit()
Then I have an event handler:
ListView_AfterLabelEdit
Problem is the text is updated by the ListView after the exit of the ListView_AfterLabelEdit even handler. Not exactly intuitive.
The code execution does not pause after BeginEdit() so the next line thing wont work.
Thanks.
-
Re: ListView LabelEdit
Then I can only think of using a timer or inheriting the listview for an overrride.
-
Re: ListView LabelEdit
Thanks for all your help RobDog.