DatagridView

A

Arne Garvander

I have a dataset with one table, which I build from scratch (not using SQL
server).
It displays fine on the web with a datagrid.
I use the same dataset and apply it to a DataGridView in a windowsform. My
datagridview does not display at all. What am I doing wrong?

HistoryGrid.AutoSize = True
HistoryGrid.Parent = Me
HistoryGrid.Dock = DockStyle.Fill
HistoryGrid.AutoGenerateColumns = True
HistoryGrid.DataSource = table
 
J

Jack Jackson

If I remove
HistoryGrid.Parent = Me
My original problem goes away.

Try "Me.Controls.Add(HistoryGrid)" instead of "HistoryGrid.Parent =
Me".

The documentation says that setting a control's Parent property to
Nothing removes it from the parent's Controls collection, but doesn't
mention setting Parent. Maybe doing it that way doesn't work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top