p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

aspdotnet_website_programming thread: adjusting width of columns of data grid


Message #1 by "poornima chalasani" <pxc5692@b...> on Tue, 4 Mar 2003 14:49:39
can anyone pls tell me how to adjust the width of columns of  datagrid in 
VB.NET .. i have tried using the code already published here ..but it's 
not working for me.
thanking u
poornima
Message #2 by "Riede, Doug D [PCS]" <priede01@s...> on Tue, 4 Mar 2003 08:57:57 -0600
Here is what I use.

'************Sets the Column Widths in the DataGrid***************
                
                    Dim dgts As DataGridTableStyle
                    dgts = New DataGridTableStyle()
                    dgts.MappingName = "Product"
                    grdPriority.TableStyles.Add(dgts)
                    dgts.GridColumnStyles(0).Width = 45
                    dgts.GridColumnStyles(1).Width = 125
                    dgts.GridColumnStyles(2).Width = 155
                    dgts.GridColumnStyles(3).Width = 30
                    dgts.GridColumnStyles(4).Width = 140
                    dgts.GridColumnStyles(5).Width = 60
                    dgts.GridColumnStyles(6).Width = 60
                    For I = 0 To 6
                        dgts.GridColumnStyles(I).NullText = ""

                    Next I
 
'*****************************************************************

Thank you,
Doug Riede
Product Planning & Strategy
Subscriber Equipment
xxx-xxx-xxxx
Sprint PCS



-----Original Message-----
From: poornima chalasani [mailto:pxc5692@b...]
Sent: Tuesday, March 04, 2003 8:50 AM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] adjusting width of columns of
data grid


can anyone pls tell me how to adjust the width of columns of  datagrid in 
VB.NET .. i have tried using the code already published here ..but it's 
not working for me.
thanking u
poornima
---
Professional Design Patterns in VB.NET: 
Building Adaptable Applications

Want to know how design patterns bring reusable 
design and adaptabilty to your applications? How 
to recognize the need for a design pattern 
solution? How to select, design, and implement 
the right patterns? How parts of the .NET Framework 
(like the .NET Data Providers and .NET Remoting) 
take advantage of design patterns? This book 
presents a practical approach to using design 
patterns in VB.NET, by focusing on the relevance 
of design patterns in the different tiers of a 
distributed n-tier architecture. 

http://www.wrox.com/books/1861006985.htm

Message #3 by "poornima chalasani" <pxc5692@b...> on Tue, 4 Mar 2003 15:53:19
thank u very much .but when i am declaring 
Dim dgts As DataGridTableStyle
it showing me error with DataGridTableStyle...(Showing it not valid type)
can u pls tell me what mistake i am doing .. Do i need to inherit any 
class  or anything ?
thanking u
poornima 
> Here is what I use.

'************Sets the Column Widths in the DataGrid***************
                
                    Dim dgts As DataGridTableStyle
                    dgts = New DataGridTableStyle()
                    dgts.MappingName = "Product"
                    grdPriority.TableStyles.Add(dgts)
                    dgts.GridColumnStyles(0).Width = 45
                    dgts.GridColumnStyles(1).Width = 125
                    dgts.GridColumnStyles(2).Width = 155
                    dgts.GridColumnStyles(3).Width = 30
                    dgts.GridColumnStyles(4).Width = 140
                    dgts.GridColumnStyles(5).Width = 60
                    dgts.GridColumnStyles(6).Width = 60
                    For I = 0 To 6
                        dgts.GridColumnStyles(I).NullText = ""

                    Next I
 
'*****************************************************************

Thank you,
Doug Riede
Product Planning & Strategy
Subscriber Equipment
xxx-xxx-xxxx
Sprint PCS



-----Original Message-----
From: poornima chalasani [mailto:pxc5692@b...]
Sent: Tuesday, March 04, 2003 8:50 AM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] adjusting width of columns of
data grid


can anyone pls tell me how to adjust the width of columns of  datagrid in 
VB.NET .. i have tried using the code already published here ..but it's 
not working for me.
thanking u
poornima
---
Professional Design Patterns in VB.NET: 
Building Adaptable Applications

Want to know how design patterns bring reusable 
design and adaptabilty to your applications? How 
to recognize the need for a design pattern 
solution? How to select, design, and implement 
the right patterns? How parts of the .NET Framework 
(like the .NET Data Providers and .NET Remoting) 
take advantage of design patterns? This book 
presents a practical approach to using design 
patterns in VB.NET, by focusing on the relevance 
of design patterns in the different tiers of a 
distributed n-tier architecture. 

http://www.wrox.com/books/1861006985.htm

Message #4 by "poornima chalasani" <pxc5692@b...> on Fri, 7 Mar 2003 14:22:36
hi
thank you for the code.I have tried this but it showing error invalid 
data type for datagridtablestyle..
will this work only in profeessional edition of vb.net only?
please help me out 
thanking u
poornima


 Here is what I use.

'************Sets the Column Widths in the DataGrid***************
                
                    Dim dgts As DataGridTableStyle
                    dgts = New DataGridTableStyle()
                    dgts.MappingName = "Product"
                    grdPriority.TableStyles.Add(dgts)
                    dgts.GridColumnStyles(0).Width = 45
                    dgts.GridColumnStyles(1).Width = 125
                    dgts.GridColumnStyles(2).Width = 155
                    dgts.GridColumnStyles(3).Width = 30
                    dgts.GridColumnStyles(4).Width = 140
                    dgts.GridColumnStyles(5).Width = 60
                    dgts.GridColumnStyles(6).Width = 60
                    For I = 0 To 6
                        dgts.GridColumnStyles(I).NullText = ""

                    Next I
 
'*****************************************************************

Thank you,
Doug Riede
Product Planning & Strategy
Subscriber Equipment
xxx-xxx-xxxx
Sprint PCS



-----Original Message-----
From: poornima chalasani [mailto:pxc5692@b...]
Sent: Tuesday, March 04, 2003 8:50 AM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] adjusting width of columns of
data grid


can anyone pls tell me how to adjust the width of columns of  datagrid in 
VB.NET .. i have tried using the code already published here ..but it's 
not working for me.
thanking u
poornima
---
Professional Design Patterns in VB.NET: 
Building Adaptable Applications

Want to know how design patterns bring reusable 
design and adaptabilty to your applications? How 
to recognize the need for a design pattern 
solution? How to select, design, and implement 
the right patterns? How parts of the .NET Framework 
(like the .NET Data Providers and .NET Remoting) 
take advantage of design patterns? This book 
presents a practical approach to using design 
patterns in VB.NET, by focusing on the relevance 
of design patterns in the different tiers of a 
distributed n-tier architecture. 

http://www.wrox.com/books/1861006985.htm

Message #5 by "Jerry Lanphear" <jerrylan@q...> on Fri, 7 Mar 2003 08:22:16 -0700
poornima,

Just for kicks try using something like "{null}" instead of the empty string
("").
The purpose of the NullString is to display some value indicating that the
field is in fact null (Nothing in Visual Basic). It may not like the empty
string there. Other than that, I found this example on msdn. See if it
contains any insight.

Private Sub SetWidth()
    Dim dgc As DataGridColumnStyle
    dgc = DataGrid1.TableStyles(0).GridColumnStyles("id")
    dgc.Width = 500
 End Sub


Regards
----- Original Message -----
From: "poornima chalasani" <pxc5692@b...>
To: "Website Programming with ASP.NET"
<aspdotnet_website_programming@p...>
Sent: Friday, March 07, 2003 2:22 PM
Subject: [aspdotnet_website_programming] RE: adjusting width of columns of
data grid


> hi
> thank you for the code.I have tried this but it showing error invalid
> data type for datagridtablestyle..
> will this work only in profeessional edition of vb.net only?
> please help me out
> thanking u
> poornima
>
>
>  Here is what I use.
>
> '************Sets the Column Widths in the DataGrid***************
>
>                     Dim dgts As DataGridTableStyle
>                     dgts = New DataGridTableStyle()
>                     dgts.MappingName = "Product"
>                     grdPriority.TableStyles.Add(dgts)
>                     dgts.GridColumnStyles(0).Width = 45
>                     dgts.GridColumnStyles(1).Width = 125
>                     dgts.GridColumnStyles(2).Width = 155
>                     dgts.GridColumnStyles(3).Width = 30
>                     dgts.GridColumnStyles(4).Width = 140
>                     dgts.GridColumnStyles(5).Width = 60
>                     dgts.GridColumnStyles(6).Width = 60
>                     For I = 0 To 6
>                         dgts.GridColumnStyles(I).NullText = ""
>
>                     Next I
>
> '*****************************************************************
>
> Thank you,
> Doug Riede
> Product Planning & Strategy
> Subscriber Equipment
> xxx-xxx-xxxx
> Sprint PCS
>
>
>
> -----Original Message-----
> From: poornima chalasani [mailto:pxc5692@b...]
> Sent: Tuesday, March 04, 2003 8:50 AM
> To: Website Programming with ASP.NET
> Subject: [aspdotnet_website_programming] adjusting width of columns of
> data grid
>
>
> can anyone pls tell me how to adjust the width of columns of  datagrid in
> VB.NET .. i have tried using the code already published here ..but it's
> not working for me.
> thanking u
> poornima
> ---
> Professional Design Patterns in VB.NET:
> Building Adaptable Applications
>
> Want to know how design patterns bring reusable
> design and adaptabilty to your applications? How
> to recognize the need for a design pattern
> solution? How to select, design, and implement
> the right patterns? How parts of the .NET Framework
> (like the .NET Data Providers and .NET Remoting)
> take advantage of design patterns? This book
> presents a practical approach to using design
> patterns in VB.NET, by focusing on the relevance
> of design patterns in the different tiers of a
> distributed n-tier architecture.
>
> http://www.wrox.com/books/1861006985.htm
>
> ---
> Professional Design Patterns in VB.NET:
> Building Adaptable Applications
>
> Want to know how design patterns bring reusable
> design and adaptabilty to your applications? How
> to recognize the need for a design pattern
> solution? How to select, design, and implement
> the right patterns? How parts of the .NET Framework
> (like the .NET Data Providers and .NET Remoting)
> take advantage of design patterns? This book
> presents a practical approach to using design
> patterns in VB.NET, by focusing on the relevance
> of design patterns in the different tiers of a
> distributed n-tier architecture.
>
> http://www.wrox.com/books/1861006985.htm
>
>
>

Message #6 by "poornima chalasani" <pxc5692@b...> on Fri, 7 Mar 2003 17:00:54
hi
thank you very much.I got it .
with regards
poornima

  Return to Index