I have a
on a form.
When I add a new item to the
, I am adding a custom class called
. In the
class I have overridden the
method to display the
This works great when I add all of the new items. They are stored correctly in the
and they are displayed correctly.
My problem comes when I try to rename a
. I have a
that I use and a simple
to allow the user to rename the item. It works properly and renames the
property of the
, however, it does not update what is displayed in the
When I click the "Add" button, it adds a new
with the name "New Dataset". Then, the user right-clicks on that item and they click the "Rename" button. This loads up an
asking them to enter a new name and loads the original name into the
The user enters a new name hits enter and I run:
((MyMDX.Query)lboDataSets.SelectedItem).Name = newName;
CType(lboDataSets.SelectedItem, myMDX.Query).Name = newName
This does update the
to reflect the new name, however, the displayed value of the
is still "New Dataset".
I have tried running
and I have tried changing
and nothing updates the displayed value.
So, how can I get the displayed value to update?
No one has an answer? I was able to fake it by storing the
as a temporary object and then removing the original item, and inserting the temp object back into the original place, but that seems more like a work-around than an actual solution.
I'm on the main thread...the one that the
was created on. So, I don't need to use Invoke at that point. And I've tried Invalidate(), but like you said, it seems to store the name statically and it doesn't change when the underlying data changes. I've tried both
and neither one forces a call back to the