ListView.Editable, how does it work?
Posted
#1
(In Topic #165)
Trainee
I have a ListView, on which the Editable property is set to True.
I had read this old forum post: http://gambas.8142.n7.nabble.com/ColumnView-Editable-True-td51747.html#a51776
Granted it's ColumnView, but I had hoped it would function similarly. I was hoping that I would be able to double-click to edit a ListView item. I want to be able to rename the entry after it's been created.
I started writing a modal dialogue for a corresponding "Rename" button, but if it's directly supported through the native component, I'd rather use that.
Any tips?
Thanks!
Posted
Guru

I had a look at this issue and discovered that you can edit a list item by pressing the [F2] key. If you want to be able to edit by clicking on a list item you need a routine to catch the click event. Put the code below in 'Graphical application' and run it.
Code (gambas)
- hListView.Current.Rename
EDIT: - You can change Public Sub ListView1_Click() to Public Sub ListView1_DblClick() for a double click rather that a single click.
Let us know how you get on.
Posted
Trainee
That's certainly much less to upkeep over the modal dialog change I had been writing.
1 guest and 0 members have just viewed this.



