Check if the objects are children and if yes compare them.
[Visual Basic .NET] Public Function Compare ( _ ByVal gxObject1 As IGxObject, _ ByVal gxObject2 As IGxObject, _ ByVal ascending As Boolean _ ) As Integer
[C#] public int Compare ( IGxObject gxObject1, IGxObject gxObject2, bool ascending );
Product Availability
Available with ArcGIS Desktop.