Problem with TabControl & DataGridView

Hi

I′m creating my first ever program (Contact manager) with Visual Basic 2005 express and sql express.

I have a TabControl with 3 pages.

First table (Contacts) is on the first page of Tab Control (DataGridView) and the second Table (Children) is on the second page of TabControl.

I hided columns that I don′t want to see in DataGridViews. On the first page it is ContactID from the contact table and on the second page there are two hided columns - ChildrenID and ContactID.

The problem is that I′m not able to hide ChildrenID on the second page.

But when I move the children DataGridView to the first page of my tabcontrol the childrenID is hided as it

should be.

Is there a way I can hide this column.

Thank you

[777 byte] By [Helimees] at [2007-12-25]
# 1

DGVOrganization.Columns(0).Visible = False

Is this what you are asking?

ReneeC at 2007-8-31 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 2

Thanx for your answer

I try to explain better.

When I drag the Children table as DataGridView to the first tab and hide the unwanted column via

DataGridView Tasks -> Edit Columns - then everything is OK.

But as soon as I drag it to the second tab of my tabcontrol and set the visible to false - nothing happens - the column is still there.

Only codes I have written so far are for AddNew, Save, Delete and Find buttons.

So I′m not sure what code should I write before that code you gave me.

Thanks again

Helimees at 2007-8-31 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 3

You're using the DataDesigner for this?

ReneeC at 2007-8-31 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 4

I′m not sure what the DataDesigner is - there is desing view and code view

But I think the answer is yes - almost everything is done in design view.

I′ve been building this little app for a week now - and this is really a first time for me to build a program.

It is almost complete and working great but this one thing getting on my nerves.

Helimees at 2007-8-31 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...