does OnAutoGeneratingColumn e.cancel affect Table.Column.Count?

时间:2018-02-01 18:27:33

标签: c# mysql wpf

If I use OnAutoGeneratingColumn to cancel some columns that I don't necessarily want to generate, will it affect the number of columns in Table.Columns.Count?

Context

I'm iterating through a table, row by row, taking each value and passing it through to an insert SQL command. Right now it lines up so that each entry is associated properly. Will I disrupt this with e.cancel? Will row[1] no longer point to what it once did if row[0] was e.cancel'd?

for (int i = 0; i < table.Dummy.Columns.Count; i++)
{
    // if we're past our first entry, add room for the next before entering it
    if (i != 0)
    {
        InsertIntoTableQuery.AddIntPrm();
    }
    //if our column has an entry, add it into our table.
    if (row[i] != null)
    {

        InsertIntoTableQuery.Prms[i].Val = row[i];
    }
}

1 个答案:

答案 0 :(得分:0)

没有!我弄清楚为什么我错了,这不是原因。您可以取消wpf数据网格中的列生成,而无需实际更改表索引。事后看来,非常明显。