Iterate over an Enum subgroup
This answer assumes there's no way the different "groups" would actually belong in different enum types. Otherwise the only sensible answer is "if you have different groups of related values, put them in different enum types". Status is a fairly broad name (enum types shouldn't have "Enum" in their names) that doesn't really says anything - if you have an Availability group with NotAvailable and Available possible values, then have an Availability enum with these values.



That's [very] little more than a hard-coded Enum.GetValues helper...

Define your enum vertically:

public enum Status
{
    Unknown,
    Known,
    NotAvailable,
    Available,
}


Then it's much easier to add attributes, e.g. a [Description]:

public enum Status
{
    [Description("Device is unknown.")]
    Unknown,
    [Description("Device is known.")]
    Known,
    [Description("Device is not available.")]
    NotAvailable,
    [Description("Device is available.")]
    Available,
}


Or whatever. If you have enum values that semantically related and need to regroup them, you can use flags for that. Use powers of 2 to specify explicit underlying values for each enum; you can use bit-shifting to simplify that:

[Flags]
public enum Status
{
    Unknown = 1 &lt;&lt; 0,
    Known = 1 &lt;&lt; 1,
    NotAvailable = 1 &lt;&lt; 2,
    Available = 1 &lt;&lt; 3,
}


And then you can define the "groupings" as you please:

[Flags]
public enum Status
{
    Unknown = 1 &lt;&lt; 0 | Knowledge | Negative,
    Known = 1 &lt;&lt; 1 | Knowledge | Positive,
    NotAvailable = 1 &lt;&lt; 2 | Availability | Negative,
    Available = 1 &lt;&lt; 3 | Availability | Positive,
    Knowledge = 1 &lt;&lt; 20,
    Availability = 1 &lt;&lt; 21,
    Positive = 1 &lt;&lt; 22,
    Negative = 1 &lt;&lt; 23,
}


And now when you're faced with a Status value, you can do this:

var isPositive = value.HasFlag(Status.Positive);


And you can get all Positive enum values rather easily:

var positiveStatusCodes = Enum.GetValues(typeof(Status))
                              .Cast&lt;Status&gt;()
                              .Where(status =&gt; status.HasFlag(Status.Positive))
                              .ToArray();


That way when you need to add enum values, just give them the proper flags and your "get all positive status codes" code doesn't need to change at all.