DataGridTableStyle

  • Thread starter Thread starter nita
  • Start date Start date
N

nita

I'm just starting out, and it's incredibly frustrating when I see
sample code and then try to implement it.
Case in point. I'm populating a collection then binding it to a
datagrid. That works great. The problem is the columns are in the wrong
order. OK. I'll use the datagridtablestyle. But when I add the
following statement;

Dim tableStyle As New DataGridTableStyle

I get an error when I build the project;

Type 'DataGridTableStyle' is not defined.

so....is there something I have to import?

please help before I go bald from pulling out my hair!!!
thanks,
nita
 
Hi,

It is part of the system.windows.forms namespace. You should not
have any problems referencing it from a windows forms application.

Ken
 
It is part of the system.windows.forms namespace. You should not
have any problems referencing it from a windows forms application.
As long as you use a windowsform for this.

Just thinking what this crazy error can be.

Cor
 
nita said:
I'm just starting out, and it's incredibly frustrating when I see
sample code and then try to implement it.
Case in point. I'm populating a collection then binding it to a
datagrid. That works great. The problem is the columns are in the wrong
order. OK. I'll use the datagridtablestyle. But when I add the
following statement;

Dim tableStyle As New DataGridTableStyle

I get an error when I build the project;

Type 'DataGridTableStyle' is not defined.

so....is there something I have to import?

please help before I go bald from pulling out my hair!!!
thanks,
nita

This is very odd. That should work.

Try refering to it fully.

Dim tableStyle As New System.Windows.Forms.DataGridTableStyle

If that fails. Start a new project, use Windows Application, and go to
the code. Paste that line and see if it compiles.

B.
 
Back
Top