From the C# 4.0 Specification:
1.10 Enums
Enum values can be converted to integral values and vice versa using
type casts. For example
int i = (int)Color.Blue; // int i = 2;
Color c = (Color)2; // Color c = Color.Blue;
One additional thing to be aware of is that you are permitted to cast any integral value in the range of the enum's underlying type (by default that's int), even if that value doesn't map to one of the names in the enum declaration. From 1.10 Enums:
The set of values that an enum type can take on is not limited by its
enum members. In particular, any value of the underlying type of an
enum can be cast to the enum type and is a distinct valid value of
that enum type.
So, the following is also permitted with the enum in your example:
det.documentStatus = (detallistaDocumentStatus) 42;
even though there's no enum name that has the value 42
.