VB.NET-Column header of DataGridView when importing the DataSet -
insert data dataset..
dim table new datatable table.columns.add("name") table.columns.add("score") table.tablename = "group1" dataset.tables.add(table)
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
Post a Comment