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
145
XamGrid not updating when underlying data changes
posted

Hi,

We have a XamGrid (version 10.3.20103.1006) on a page that is bound to an Observable collection.  The data is hierarchical and so the grid has three ColumnLayout levels.  Some of the ColumnLayout columns are UnboundColumn types and use converters.  We have a refresh button on the same page as the grid that when clicked executes a method on the ViewModel to call a WCF service and reset the exposed Observable collection. 

The Observable collection property on the ViewModel is as follows: 

public ObservableCollection<ServiceActivityData> Activities
{
get { return _activities; }
set
{
 if (_activities != value)
 {
  _activities =
value;
  base.RaisePropertyChanged("Activities");
 }
}

Now the problem is that the Unbound columns on the grid do not reflect changes to the data after a refresh.  Here are the first few lines from one of our converters used by one of the unbound columns:

public class LogStatusImageSourceConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
  UnboundColumnDataContext ty = (UnboundColumnDataContext)value;
  TransferLogData tl = (TransferLogData)ty.RowData;
 
 

The converter fires after a refresh but the data in RowData is not getting updated and doesn't correspond to the new data in the underlying ObservableCollection.

What is happening here?  How can I force the RowData to keep in sync with the underlying ItemSource of the grid?

Regards,

Myles