I was playing with objectviews. I had no problems displaying iList of objects, but when I try to add rows, my DataGrid (UltraWinGrid from Infragistics) displays an error. I've debugged ObjectView and I found:
public ObjectRowView AddNew()
{
System.Diagnostics.Debug.WriteLine("AddNew()");
ObjectRowView rowView = collectionHandler.AddNew();
//int index = collectionHandler.IndexOf(rowView.Object);
int index = collectionHandler.IndexOf(rowView);
OnAddNew(index);
return rowView;
}
i've commented IndexOf line because implementation of IndexOf does throw an exception if the parameter is not rowView type.
This makes the program continue, but I receive an exception after sending ListChanged events. My datagrid says that it's a wrong index (my example has 3 rows and I try to add a 4 one)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was playing with objectviews. I had no problems displaying iList of objects, but when I try to add rows, my DataGrid (UltraWinGrid from Infragistics) displays an error. I've debugged ObjectView and I found:
public ObjectRowView AddNew()
{
System.Diagnostics.Debug.WriteLine("AddNew()");
ObjectRowView rowView = collectionHandler.AddNew();
//int index = collectionHandler.IndexOf(rowView.Object);
int index = collectionHandler.IndexOf(rowView);
OnAddNew(index);
return rowView;
}
i've commented IndexOf line because implementation of IndexOf does throw an exception if the parameter is not rowView type.
This makes the program continue, but I receive an exception after sending ListChanged events. My datagrid says that it's a wrong index (my example has 3 rows and I try to add a 4 one)
It looks like this is from the last official release, since the new code that is in CVS is pretty different.
Could you give the current CVS version a try and see if that works?
OK, thanks, I tried the official release instead of the CVS version. I'm having a try over that version right now.
Thanks