Im wondering...since itemArray is class scope...where do you initialize each object?
Anyhow, i don't see how it's sorting...
'Check that we're dealing with sysCode objects...
If Not TypeOf x Is sysCode Or Not TypeOf y Is String Then
Throw New InvalidCastException("Expected sysCode and String object")
End If
'Check the codes...
Return String.Compare(CType(x, sysCode).Name, y.ToString)
You are checking for a sysCode object and a string. When sorting, you will only be getting syscode objects...