I have the string (from the tempItem.Text) I need to use it as an EnumValue (from comments)
You can use Enum.Parse or Enum.TryParse<TEnum>
method something like:
EnumValue enumValue;
if (Enum.TryParse<EnumValue>("Materials", out enumValue))
{
//parsing successful
}
else
{
//parisng failed.
}
output:
enumValue = Materials
If your enum is defined as:
public enum EnumValue
{
Clients = 1,
Materials = 2,
}