PC Review


Reply
Thread Tools Rate Thread

Column Size in Datagrid

 
 
Jennifer Hinojosa
Guest
Posts: n/a
 
      16th Oct 2008
Will someone please help me out by telling me how to set the width of a
column in a datagrid using VB?

Thanks for your help!

Jennifer
 
Reply With Quote
 
 
 
 
Aflava
Guest
Posts: n/a
 
      16th Oct 2008
Hi,

Are you talking about a DataGrid or a DataGridView?
You have a Width property for DataGridViewColumn (and should be the same for
datagrid).


--
Aflava
Windows Forms Components
http://www.aflava.com

"Jennifer Hinojosa" <Jennifer (E-Mail Removed)> wrote in
message news:B6B1D8A4-6E1B-4046-91AF-(E-Mail Removed)...
> Will someone please help me out by telling me how to set the width of a
> column in a datagrid using VB?
>
> Thanks for your help!
>
> Jennifer



 
Reply With Quote
 
Jennifer Hinojosa
Guest
Posts: n/a
 
      16th Oct 2008
I'm talking about a DataGrid in Windows Forms - not a DataGridView.

I've got some code below which doesn't work. It's erroring out on the 2nd
line.

Dim myGridColumns As GridColumnStylesCollection
myGridColumns = dgCustomerList.TableStyles(0).GridColumnStyles
myGridColumns.Item(1).Width = 200
myGridColumns.Item(2).Width = 250
myGridColumns.Item(3).Width = 250
myGridColumns.Item(4).Width = 100
myGridColumns.Item(5).Width = 100
myGridColumns.Item(6).Width = 200
myGridColumns.Item(7).Width = 200
myGridColumns.Item(8).Width = 200

"Aflava" wrote:

> Hi,
>
> Are you talking about a DataGrid or a DataGridView?
> You have a Width property for DataGridViewColumn (and should be the same for
> datagrid).
>
>
> --
> Aflava
> Windows Forms Components
> http://www.aflava.com
>
> "Jennifer Hinojosa" <Jennifer (E-Mail Removed)> wrote in
> message news:B6B1D8A4-6E1B-4046-91AF-(E-Mail Removed)...
> > Will someone please help me out by telling me how to set the width of a
> > column in a datagrid using VB?
> >
> > Thanks for your help!
> >
> > Jennifer

>
>
>

 
Reply With Quote
 
Aflava
Guest
Posts: n/a
 
      17th Oct 2008
Hello,

Could you please copy and paste the error message?

Thanks and regards,


--
Aflava
Windows Forms Components
http://www.aflava.com

"Jennifer Hinojosa" <(E-Mail Removed)> wrote in
message news:F842BDE9-A4C4-4150-9AFB-(E-Mail Removed)...
> I'm talking about a DataGrid in Windows Forms - not a DataGridView.
>
> I've got some code below which doesn't work. It's erroring out on the 2nd
> line.
>
> Dim myGridColumns As GridColumnStylesCollection
> myGridColumns = dgCustomerList.TableStyles(0).GridColumnStyles
> myGridColumns.Item(1).Width = 200
> myGridColumns.Item(2).Width = 250
> myGridColumns.Item(3).Width = 250
> myGridColumns.Item(4).Width = 100
> myGridColumns.Item(5).Width = 100
> myGridColumns.Item(6).Width = 200
> myGridColumns.Item(7).Width = 200
> myGridColumns.Item(8).Width = 200
>
> "Aflava" wrote:
>
>> Hi,
>>
>> Are you talking about a DataGrid or a DataGridView?
>> You have a Width property for DataGridViewColumn (and should be the same
>> for
>> datagrid).
>>
>>
>> --
>> Aflava
>> Windows Forms Components
>> http://www.aflava.com
>>
>> "Jennifer Hinojosa" <Jennifer (E-Mail Removed)> wrote
>> in
>> message news:B6B1D8A4-6E1B-4046-91AF-(E-Mail Removed)...
>> > Will someone please help me out by telling me how to set the width of a
>> > column in a datagrid using VB?
>> >
>> > Thanks for your help!
>> >
>> > Jennifer

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
My Datagrid Column Showing Column size X in each cell =?Utf-8?B?QWRuYW4=?= Microsoft Dot NET Compact Framework 3 13th Dec 2004 06:25 AM
datagrid column size =?Utf-8?B?Y2hyaXM=?= Microsoft Dot NET Compact Framework 0 30th Jul 2004 01:05 AM
Datagrid column size nomenklatura Microsoft Dot NET Compact Framework 1 20th Apr 2004 06:15 PM
Datagrid column size and row size Salih Ataoz Microsoft Dot NET 0 10th Nov 2003 12:45 PM
Column Size on a datagrid Tobe Microsoft ASP .NET 1 30th Jul 2003 04:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:44 AM.