Duplicate column in DataTable when adding row

后端 未结 2 769
孤独总比滥情好
孤独总比滥情好 2021-01-25 15:10

I create a DataTable and bind it to a DataGrid. My DataSource consist of one Table (FooTable) which consist of one column (FooName).

The following codes runs fine - exce

2条回答
  •  粉色の甜心
    2021-01-25 15:42

    Try

    dg1.AutoGenerateColumns = false;
    

    Should do the work for you. For now the datagrid automatically generates the columns AND adds the one you asked

提交回复
热议问题