The code is below, I'm testing with android platform.When the item is removed, it remains in the listview, and when you interact with it the listview complains that the adapter state changed without a notification (Illegal State Exception). Changing items doesnt propagate the update.) The only workaround is to do items { get { return _items; } set{ items = value; } } public Buggy List View () { items.Add (new myvm () { txt = "daveeeeeeeeee" }); Initialize Component (); Binding Context = this; } void Rfirst(object s, Event Args e) { items. Items Source = items; } } Exception: The content of the adapter has changed but List View did not receive a notification.

wpf listview itemssource not updating-55

(That’s what happens if you left-align an element in WPF.) It gets worse if your text boxes are initially empty—they start out very thin. It’s hard to imagine why anyone might want that behaviour, so you’ll probably want to change it.

A simple but somewhat unsatisfactory fix is to set the simply took its width from the column header?

That way, you can set a sensible initial width, and then allow the user to make the text boxes wider by resizing the column.

To do this, we need to make sure the list column contents have a horizontal alignment of hadn’t used the normal default. (So far I’ve worked out how to do this twice, and then promptly forgotten again on both occasions.

I’m putting it in a blog so that next time I’ll remember, or at least I’ll know where to look.)The alignment of the column content is controlled by the now fills the column: These text boxes will now resize when the user resizes the column header.(Note: this particular example isn’t terribly useful, because it binds directly to an array of strings.

Strings are immutable, so editing the string causes WPF to generate a new string.

Because arrays don’t generate change notifications, the Length column fails to update.

In practice, you’d bind to properties of some object designed to be edited, so you wouldn’t see this problem.

I’ve over-simplified the data binding here so as not to obscure the main point.)The actually copies its horizontal alignment down to each individual column.