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
1915
ActiveRecord is NULL when binding to a Collection of interface instances
posted

I have a question about binding  XamDataGrid 10.2. Here is the ObservableCollection I am binding my grid to:

private ObservableCollection<IObj> _objList= new ObservableCollection<IObj>();

public ObservableCollection<IObj> ObjList{

get { return _objList; }

set{_objList=value;RaisePropertyChanged("ObjList");}

}

private IObj _currentRecord;

public IObj CurrentRecord{

get{ return _currentRecord;}

set{ if (value!= _currentRecord) _currentRecord = value; RaisePropertyChanged("CurrentRecord");}

}

In Xaml I set the binding as follows:

<igDP:XamDataGrid x:Name="xamDataGrid" DataSource="{Binding ObjList}" ActiveRecord="{Binding Path=CurrentRecord,Mode=TwoWay}" AutoFit="True" IsSynchronizedWithCurrentItem="True" UpdateMode="OnCellChangeOrLostFocus" >

I can see get and set properties of the CurrentRecord working but the set value is null. Do I need a converter? Notice that I am binding to a collection of interface rather than class implementing the interface IObj. Is that what is causing the problem? Thanks.

PS I referenced suggested way of binding ActiveRecord disussed here: http://es.infragistics.com/community/forums/p/30668/413726.aspx#413726

  • 138253
    Offline posted

    Hello Andre,

     

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

  • 138253
    Offline posted

    Hello Andre,

     

    Thank you for your post. I have been looking into it and I can suggest you bind the XamDataGrid’s ActiveDataItem Property instead of ActiveRecord, because the ActiveRecord is of type Record and the DataItem is tracked by the ActiveDataItem. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.