I was having a real hard time with this error – when I set grid group in in code by assigning IsGroupedBy property of a column to “true” – every other grid.databind() was throwing error “Failed to compare two elements in the array.” Event though I cleared (or so I thought) Bands collection, Rows collection and Columns collections with their respective .Clear() methods.
The solution?