Hi,
I'm validating the Infragistics UltraGrid (version 6.3) for use in a project. Is there a way to use a bindingsource with complex properties? Example:
class cAddress{ public string Street { get; set; }}
class cResident{ public string Lastname { get; set; } public cAddress Address { get; set; }}
I tried to do the following:ArrayList _Residents = GetResidents() //returns cResident CollectionBindingSource _BindingSource = new BindingSource(_Residents);UltraGrid _UltraGrid = new UltraGrid(); // Would be initialized in designtime for columns etc._UltraGrid.DisplayLayout.Bands[0].Columns[1].Key = "Lastname";_UltraGrid.DisplayLayout.Bands[0].Columns[2].Key = "Address.Street";The property for column 2 does not show up.Any suggestions or help would be great.
Thanks,Iwe
I'm confused. I don't see anything in your sample that adds a new property descriptor, nor send a ListChanged notification. In fact, it looks like you are not even implementing IBindingList, but are instead deriving from List<T>.
List<T> doesn't even have a ListChanged event. If you are going to be data binding, I recommend that you use BindingList<T> instead. It's a more robust class with better support for data binding, including the ListChanged event.
Hi, I did the same but for some reason the grid is not reflecting the column added. Please have a look at the attached sample. Please ignore my previous post
Thanks for the info Mike. I did that but for some reason the grid is not reflecting the change. I am attaching a sample project. Can you please let me know What am I doing wrong?
What you have to do is notify the bound controls that a new column was added (or removed or changed). You do that through the IBindingList interface by firing the ListChanged event and passing in ListChangedType.PropertyDescriptorAdded.
Hi Mike, I am implementing ITYpedList but say in the above example, What if I want to add more properties at run time? Is there a way GetItemProperties be called when I modify the Address object? I have a requirement where user can add columns by clicking a button(I know there are other ways to do it, but our DS is complex and Itypedlist will be an elegant solution).