I am having issues with translating this vb.net line into a strict proof one
[Enum].GetValues(GetType(ReferenceOutput))(DataGrid1.SelectedIndex)
ReferenceOutput is a class and the datagrid1.selectedindex is the one selected in the datagrid . How do I translate this into a strict proof line. I get followin error now.
Error 1 Option Strict On disallows late binding.
Thanks
The most robust approach would be to use
Enum.TryParsewhich is a new generic method:This is the old verbose, unchecked unboxing approach: