Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET Database & Reporting

Post new topic   Reply to topic
DataGrid cell height in VB.NET
View previous topic :: View next topic  
Author Message
oasisok
Newbie


Joined: 15 Sep 2004
Posts: 7
Location: Oklahoma

PostPosted: Sep 15th, 2004 11:48 AM    Post subject: DataGrid cell height in VB.NET Reply with quote

I accidently posted this in the Database & Reporting for VB 4, 5, 6. :angel:

I hope this is the place to go for VB.NET questions. I created a Windows
Application using DataGrid in VB.NET. I used the example I found on this
video to bind two tables together and show it on a DataGrid:

[new user link]

My question is this: in table(1) there is a field called Description. Is
there a way to increase the height and width of the cell to show the
description? If the cell is not large enough (sometimes the description can
get a bit 'wordy') is there a way to use a scrollbar? I figured out a way to increase the width from the table(0) but not height or scrollbars. :wacko:

I do need an answer ASAP.

TIA

James :thumbs:
Back to top
View user's profile Send private message Visit poster's website
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Sep 16th, 2004 01:15 AM    Post subject: Reply with quote

Hi oasisok,

You can set height property through DataGridTableStyle class.

[vb:1:e08b252a03]Dim ts1 As New DataGridTableStyle()
With ts1
.MappingName = "ASM"
.PreferredColumnWidth = 125
.PreferredRowHeight = 15
End With

'And column width through DataGridColumnStyle class.
Dim cs1 As DataGridColumnStyle = New DataGridTextBoxColumn()
cs1.MappingName = "Qt"
cs1.HeaderText = "blah"
cs1.Width = 55
cs1.ReadOnly = True
ts1.GridColumnStyles.Add(cs1)
grdByMonth.TableStyles.Add(ts1)[/vb:1:e08b252a03]

for a particular cell though I'm afraid you would need some other technique for instance showing a text box on cell place. However using column width and cells height properties through DataGridColumnStyle, DataGridTableStyle classes should be enough for most cases.

Hope this helps!

Thanks!
_________________
Code Snippets, Tutorials, Utilities, Controls

Low cost Web Hosting
Hosting starts at as low as $4 per year!


Always follow posting guidelines
Put your VB code in [vb ] your code [ /vb] tags!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Sep 16th, 2004 03:29 AM    Post subject: Reply with quote

Hi oasisok,

Does this helps ?

Thanks!
_________________
Code Snippets, Tutorials, Utilities, Controls

Low cost Web Hosting
Hosting starts at as low as $4 per year!


Always follow posting guidelines
Put your VB code in [vb ] your code [ /vb] tags!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
oasisok
Newbie


Joined: 15 Sep 2004
Posts: 7
Location: Oklahoma

PostPosted: Sep 16th, 2004 11:24 AM    Post subject: Reply with quote

Yup, worked great!! Thanks! =D
Back to top
View user's profile Send private message Visit poster's website
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Sep 17th, 2004 05:11 AM    Post subject: Reply with quote

Hi oasisok,

Glad to be of help!

Thanks!
_________________
Code Snippets, Tutorials, Utilities, Controls

Low cost Web Hosting
Hosting starts at as low as $4 per year!


Always follow posting guidelines
Put your VB code in [vb ] your code [ /vb] tags!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
ajani
Newbie


Joined: 24 Jun 2006
Posts: 2

PostPosted: Jul 3rd, 2006 07:59 PM    Post subject: Reply with quote

Tsunami Searcher:
[new user link] [new user link] [new user link] [new user link] [new user link]
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET Database & Reporting All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic