I'm having a bit an issue wrapping my head around this for whatever reason.I have an UltraGrid with data bound like so: UltraGrid.SetDataBinding( IBindingList<T>)
Later, I added an UltraCombo (because I like the flexibility of its appearance) but I've run into issues with the ListChanged events not firing properly. I stepped into the UltraGrid_CellChanged event and can see that the value of my grid cell hasn't changed at all, even though its display text has.
My question simply, I suppose - Which object can I bind to a grid column that supports IBindingList and ListChanged events but also has the appearance capabilities of the UltraCombo?
Thanks.
Hello ,
When you are create a BindingList<T> and you want ListChange event to be fired when you change a property of T class, then you should implement INotifyPropertyChanged Interface to your T class. Aftet that bind this BindingList<T> to the UltraGrid and change the value of some cell, then the ListChange would fire. More about INotifyPropertyChanged Interface you could find here:
http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx
Also I am attaching a small sample where I have a class Patient, which implements INotifyPropertyChanged Interface and when you change the value of some cell and leave this cell (in order to commit changes) you will get a message from ListChange event.
Please let me know if you have any further questions related to Infragistics.
Hi,
I have reviewed your solution. I may have been misleading in my initial question, so here it is again with a little more information. I am using UltraCombo.SetDataBinding(BindingList<T>) where my binding list does in fact implement INotifyPropertyChanged. The debugger throws a NotSupportedException: "The list must be an IBindingList to AddNew."At this point I'm not sure why I am getting this error. My first thought was that maybe the UltraCombo did not support ListChanged, however your solution proves that it does.
I am able to bypass this exception and allow the UltraCombo to bind anyway. The behaviour I am seeing however, is that ListChanged events will be thrown, but will not update the T class. The ValueMember field remains constant and the DisplayMember will change text in the cell. Further, another issue I am seeing is my drop down is displaying the ValueMember instead of the DisplayMember. (I am seeing integers in my UltraCombo.)
Do you have any ideas on how to resolve this?
If you are binding to a BindingList<T> then you should never see an exception like that, since the BindingList obviously does support IBindingList.
Can you post the call stack of the exception?
Sure thing
.
Update: Further testing indicates ListChanged events are not actually thrown, and thus I believe this is the root of my problem.
Could you please modify my sample to reproduce this issue in order to be able to look into it and to try to find any solution for you.
I am waiting for your response.