all groups > dotnet windows forms > january 2008 >
You're in the

dotnet windows forms

group:

DatagridView


DatagridView Arne Garvander
1/21/2008 6:37:04 AM
dotnet windows forms: 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

--
Arne Garvander
Certified Geek
RE: DatagridView Arne Garvander
1/21/2008 7:41:15 AM
If I remove
HistoryGrid.Parent = Me
My original problem goes away.

--
Arne Garvander
Certified Geek
Professional Data Dude


[quoted text, click to view]
Re: DatagridView Jack Jackson
1/21/2008 11:51:13 AM
On Mon, 21 Jan 2008 07:41:15 -0800, Arne Garvander
[quoted text, click to view]

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
AddThis Social Bookmark Button