Duplicate column in DataTable when adding row

后端 未结 2 739
孤独总比滥情好
孤独总比滥情好 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:41

    try setting AutoGenerateColumns to false

     dg1.AutoGenerateColumns = false
    
    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题