Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2349
xamDataGrid, ObservableCollections not updating the UI, but *IS* updating the datasource
posted

Okay, I am my wits end.  The problem is that I am changing a value to a bound field in my datasource through code and it is not show up on the page -- here's the details:

1.  Installed a hotfix 2075 which I prayed would fix this issue

2.  Setting the datasource to the observable collection (initialization...):

if (grdPartsUsed.DataSource == null) {
AppPropertiesHelper.SetProperty("UsedParts", _userParts);
grdPartsUsed.DataSource = AppPropertiesHelper.GetProperty<ObservableCollection<UsedPart>>("UsedParts");
}

3.  Changing the collection item on another form:

UsedPart part = (from u in AppPropertiesHelper.GetProperty<ObservableCollection<UsedPart>>("UsedParts")
where (u.PartID == _part.PartID)
select u).Single<UsedPart>();

part.Description = "This worked.";

4.  After the change, the event that launches the form, I have a debug statement and in the view window I find that:  My Datasource for the xamDataGrid shows the correct value, HOWEVER, the UI does not update with the correct value.

5.  Convinced I had spelled the bound field incorrectly or done something wrong I tested the field (name of Description) -- if I update the field directly through the UI (the xamDataGrid) the datasource changes correctly. 

<igDataGrid:Field Name="Description" Label="Description">
<igDataGrid:Field.Settings>
<igDataGrid:FieldSettings LabelWidth="300" CellWidth="300" AllowEdit="True">
</igDataGrid:FieldSettings>
</igDataGrid:Field.Settings>
</igDataGrid:Field>

6.  There are always zero DataItems in the grid, no matter what happens (see above).

It seems to me to be straightforward, but for some reason the UI doesn't change with changes to the collection (adding items to the collection DO show though).  Can someone PLEASE help on this because I have been troubleshooting this for several days convinced that it was something I was doing wrong and at this time I am not so sure.

 

Travis