C# 使用自定义数据行会出现错误';试图以与数组不兼容的类型访问元素。';

C# 使用自定义数据行会出现错误';试图以与数组不兼容的类型访问元素。';,c#,datatable,datarow,C#,Datatable,Datarow,我正在尝试实现自己的DataRow类。DataRow和DataTable类如下所示: public class GenericFormFieldDataTable : TypedTableBase<GenericFormFieldDataRow> { public IEnumerable<ExtraInfo> Information { get; set; } public GenericFormFieldDataTable(IEnumerable<

我正在尝试实现自己的
DataRow
类。
DataRow
DataTable
类如下所示:

public class GenericFormFieldDataTable : TypedTableBase<GenericFormFieldDataRow>
{
    public IEnumerable<ExtraInfo> Information { get; set; }

    public GenericFormFieldDataTable(IEnumerable<ExtraInfo> info)
    {
        Information = info;
    }

    public void AddGenericFormFieldRow(GenericFormFieldDataRow row)
    {
        Rows.Add(row);
    }
    public GenericFormFieldDataRow AddGenericFormFieldRow(LineData data)
    {
        //THE LINE BELOW CAUSES THE CRASH
        GenericFormFieldDataRow newRow = ((GenericFormFieldDataRow)(NewRow()));
        List<object> values = new List<object>();
        ...

        Here we do things with values, Information and eventually fill datarow.LineData

        ...
        newRow.ItemArray = values.ToArray();
        Rows.Add(newRow);
        return newRow;
    }


    protected new GenericFormFieldDataRow NewRowFromBuilder(DataRowBuilder builder)
    {
        return new GenericFormFieldDataRow(builder);
    }

    protected override Type GetRowType()
    {
        return typeof (GenericFormFieldDataRow);
    }

    public GenericFormFieldDataRow this[int index]
    {
        get
        {
            return ((GenericFormFieldDataRow)(this.Rows[index]));
        }
    }
}

public class GenericFormFieldDataRow : DataRow
{
    public LineData LineData { get; set; }

    protected internal GenericFormFieldDataRow(DataRowBuilder builder) : base(builder) {}
}
代码基于数据集设计器生成的内容。我在这里遗漏了什么/做错了什么

Attempted to access an element as a type incompatible with the array.

Call stack:
System.Data.DataTable.NewRow(Int32 record) +60
   System.Data.DataTable.NewRow() +16
   GenericFormFieldDataTable.AddGenericFormFieldRow(LineData data) in GenericFormFieldDataTable.cs:37