No, it is not. A conditional statement expression has a specific type. Both types used in the expression must be of the same type or implicitly convertible to each other.
You can make it work as follows:
propertyGrid.Instance = (directoryRecord.directoryInfo != null) ? (object)directoryRecord.directoryInfo : (object)directoryRecord.fileInfo;
source share