Sample 49 is not working

May 27, 2010 at 7:37 AM
Edited May 27, 2010 at 8:31 AM

Hello

 

Sample 49 is not working with latest source. I´m unable to edit and add new rows. When I change to Sourcegrid 4.22 binany it works well.

Many other samples (29, 41) are not working when I try to add a row. It comes with Error. Data table does not have row with given index. It has only 8 number of rows,you requested to return row number 8

Matthias

Coordinator
May 27, 2010 at 11:27 AM

Looks like a bug. Are all tests green?

May 27, 2010 at 11:37 AM

All tests are green but I changed this in BoundDataView to get it working. I don´t know if it´s the solution for the problem.

BoundDataView.cs
        public virtual object this[int index]
        {
            get
            {
                if ( index > m_dataView.Table.Rows.Count)
                    throw new ArgumentException(string.Format(
                        "Data table does not have row with given index. It has only {0} number of rows," +
                        "you requested to return row number {1}",
                        m_dataView.Table.Rows.Count,
                        index));
                try
                {
                    return m_dataView[index];
                }
                catch (InvalidOperationException )
                {
                    // we sometimes get this error. Don't know why. Maybe it is multithreading issue
                    // It says that internal index is corrupt, number 13.
                    // Return null in this case, works fine afaik
                    return null;
                }
            }
        }

 

Coordinator
Jun 1, 2010 at 9:24 AM
Ok, changed that. Should be in the tip by now