Hello,
In attached solution there's a small piece of code which works in my application. This is how it should work and how it doesn't:
I understand this is not a normal flow but this is how we add new rows to grid. Any ideas?
Solution:
Thank you.
Yeah you're right, I forgot about an ObservableCollecton.
Thank you very much.
Hi,
You're adding directly to your Bills proprety. Which is fine, however, the only way the grid will know about it is if your collection implements INotifyCollectionChanged. A List<> does not implement this interface. However, an ObservableCollection<> does, and thats what you should be using.
-SteveZ
I found 1 more problem.
I added a List<> to Person class and built new grid layout. Now group rows again, then open any group and select any 1st level row. Enter some double value into the textbox in 2nd row and press "Add record". Grid must do the same as in my 1st post - open group, scroll to new child row and set it to edit mode. I got an ArgumenException.
Yes this works. Thank you
Its's basically a timing issue.
Just delay the call to EnterEditMode, and it should work:
this.Dispatcher.BeginInvoke(() =>
{
xGrid.EnterEditMode(row);
});