Home All Groups Group Topic Archive Search About
Author
26 Jul 2006 5:48 PM
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

Author
27 Jul 2006 2:24 AM
Ken Tucker [MVP]
Hi,

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

Ken
---------------------------
Show quoteHide quote
"nita" <nita_l***@yahoo.com> wrote in message
news:1153936114.195830.319150@s13g2000cwa.googlegroups.com...
> 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
>
Author
27 Jul 2006 4:41 AM
Cor Ligthert [MVP]
>        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

Show quoteHide quote
"Ken Tucker [MVP]" <vb***@bellsouth.net> schreef in bericht
news:OoomUPSsGHA.4452@TK2MSFTNGP05.phx.gbl...
> Hi,
>
>        It is part of the system.windows.forms namespace.  You should not
> have any problems referencing it from a windows forms application.
>
> Ken
> ---------------------------
> "nita" <nita_l***@yahoo.com> wrote in message
> news:1153936114.195830.319150@s13g2000cwa.googlegroups.com...
>> 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
>>
>
>
Author
27 Jul 2006 1:18 PM
Brian Tkatch
nita wrote:
Show quoteHide quote
> 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.