Menu

maybe a bug on ObjectView.AddNew ?

marcelo
2005-09-29
2013-03-07
  • marcelo

    marcelo - 2005-09-29

    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)

     
    • Martijn Boland

      Martijn Boland - 2005-09-29

      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?

       
    • marcelo

      marcelo - 2005-09-29

      OK, thanks, I tried the official release instead of the CVS version. I'm having a try over that version right now.

      Thanks

       

Log in to post a comment.

MongoDB Logo MongoDB