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
1140
GetRowEnumerator() fails need a better way to iterate groupbyrows
posted

I am trying to cycle through the grids row collection; i keep getting an exception thrown at me about "unable to cast ultraGridRow to ultraGridGroupByRow"  "weird".  Any way.  Any suggestions would be appreciated.  Here is the code I am using for now.

IEnumerable rowEnum = flagDetailGrid.Rows.GetRowEnumerator(GridRowType.GroupByRow, null, null);

try

{

foreach (UltraGridGroupByRow row in rowEnum)

{

// breaks during iteration 

Unable to cast object of type 'Infragistics.Win.UltraWinGrid.UltraGridRow' to type 'Infragistics.Win.UltraWinGrid.UltraGridGroupByRow'. 

Console.WriteLine(row.IsGroupByRow.ToString());

}

}

catch { }

 

Parents
  • 37774
    posted

    This code worked for me, so I'm not sure what's different in your application.  Is this a flat grid (granted with grouped rows), or is there a hierarchy?  You could naturally just use an UltraGridRow and check its type before proceeding, but I'd think that this should work as-is.

    -Matt

     

Reply Children
No Data