Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
365
Exception: System.ArgumentOutOfRangeException on
posted

We recently upgraded from 7.3 to 11.2 and randomly get exceptions - one of them occured on the following line as indicated by FAILS ON THIS LINE below.

This grid method contains DataTable search results for existing values entered on a form - if found, it is supposed to move the matching rows to the top of the grid and changes their appearance.
I was wondering - we do not define Infragistics.Win.UltraWinGrid.UltraGridOverride.FixedRowStyle within our code - does it need to be? The rows have always been highlighted on the top of the grid.

Any ideas how to fix this - or safe way to block it?
I found references to using BeginInvoke(new FixedRowDelegate(createFixedRow), e.Row), but this is not a Summary row and this is not a threaded app - and multiple rows could potentially become fixed/highlighted.

Thanks,
Todd

Code:

private void FixCurrentRows() {

try {

if (this.ResultsUltraGrid.Rows != null
&& (m_CurrentId != Guid.Empty || m_CurrentServiceRequestId != Guid.Empty))
{

foreach (UltraGridRow row in this.ResultsUltraGrid.Rows) {
// Fix the Current matching row to the top of the grid when Searching for an Existing individual

if (this.ResultsUltraGrid.Text == "Potential Duplicate Requests"
&& m_CurrentServiceRequestId != Guid.Empty
&& row.Cells.Exists(
"ServiceRequestId")
&& (
Guid)row.Cells["ServiceRequestId"].Value ==  m_CurrentServiceRequestId)
{

row.Fixed = true; // FAILS ON THIS LINE

row.Appearance.BackColor =

 

Color.Yellow;
row.Appearance.BackColor2 =
Color.Goldenrod;
row.Appearance.BackGradientStyle =
GradientStyle.GlassBottom50Bright;
break;
// Exit the loop since we found the current service request

}
else

if(m_CurrentId != Guid.Empty
&& row.Cells.Exists(
"UserId")
&& (
Guid)row.Cells["UserId"].Value == m_CurrentId)
{

row.Fixed = true;

row.Appearance.BackColor = Color.Yellow;
row.Appearance.BackColor2 =
Color.Goldenrod;
row.Appearance.BackGradientStyle =
GradientStyle.GlassBottom50Bright;

}

}

}

}
catch (Exception ex) {
Error.LogException(ex);
}

} 

Exception information:

Additional Information:
Exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
   at Infragistics.Shared.SparseArray.Insert(Int32 index, Object item)
   at Infragistics.Win.UltraWinGrid.RowsCollection.Move(UltraGridRow row, Int32 newIndex, Boolean forceDirtyPrimaryMetrics)
   at Infragistics.Win.UltraWinGrid.RowsCollection.MoveFixedRowsToProperLocation()
   at Infragistics.Win.UltraWinGrid.FixedRowsCollection.VerifyFixedRows(Boolean verifyScrollCount)
   at Infragistics.Win.UltraWinGrid.FixedRowsCollection.IndexOf(Object obj)
   at Infragistics.Shared.DisposableObjectCollectionBase.Contains(Object obj)
   at Infragistics.Win.UltraWinGrid.UltraGridRow.get_Fixed()
   at Infragistics.Win.UltraWinGrid.UltraGridRow.set_Fixed(Boolean value)
   at UI.WindowsForms.GeneralForms.SearchForm.FixCurrentRows()
  in d:\Sources\UI.WindowsForms\GeneralForms\SearchForm.cs:line 290

Parents Reply Children
No Data