I created a class called CustomData
which uses another one called CustomOptions
as one of its fields. I want to use the CustomData
in a DataTable
as values. Here's a short overview (simplified, the fields are private
and the accessors public
, mostly readonly and the set
is done by custom methods);
enum CustomDataOptionType
{
// Some values, not important
}
class CustomOptions
{
public CustomDataOptionType type { get; }
public Dictionary<string, string> values { get; }
// Some Methods to set the values
}
class CustomData
{
public CustomOptions options { get; }
// Some Methods to set the options
}
So, in the "actual" class that uses the ones above, I create a DataTable
, using columns that are typeof(CustomData)
.
But when I try to access the columns, e.g. by
DataRow Row = data.Rows.Find("bla");
Row["colmn1"].options; // Not possible
Why can't I access the options
-field?