VB.NET-Column header of DataGridView when importing the DataSet -


  1. insert data dataset..

    dim table new datatable table.columns.add("name") table.columns.add("score") table.tablename = "group1" dataset.tables.add(table) 
  2. combine datagridview

    dgv.datasource = dataset.tables("group1") 

    there 2 different situations

    • set column collection in designer
    • didn't set in designer

if set dgv column "name" , "score" in designer, outcome name score name score john 100 jack 100 duplicate columns appeared...

if set nothing dgv, outcome fine.

however, if there no data in dataset, column header, "name" , "score", won't show in dgv.

how solve problem? display dataset in dgv when dataset has no data , header still can displayed.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -