static bool GreaterThan(Row r1, Row r2)
{
if (r1 != null && r2 != null && r1.Device.Description != null & r2.Device.Description != null)
{
var type = r1.ComparisonType;
switch (type)
{
case DeviceComparisonTypes.CONTROLLER: return GreaterThan(r1, r2, "Controller");
case DeviceComparisonTypes.DESCRIPTION: return GreaterThan(r1, r2, "Description");
case DeviceComparisonTypes.DEVICE_ID: return GreaterThan(r1, r2, "DeviceId");
case DeviceComparisonTypes.LOCATION: return GreaterThan(r1, r2, "Location");
case DeviceComparisonTypes.MANUFACTURER: return GreaterThan(r1, r2, "Manufacturer");
}
}
if (r1.Index < r2.Index) return false;
else return true;
}