Datagrid formating

donnacha

Well-known member
Joined
Feb 27, 2003
Messages
187
Hi folks,
I am trying to display data in a datagrid that is too wide for the datagrid column. The datagrid takes up the full screen so I cant make it wider. Does anybody know how to make the datagrid text box a multi-line text box. I have tried a few things with table styles but nothing has worked yet.


Any Ideas.:confused:
 
RE datagrid

This is all ive found thus far on that subject

add Imports System.Windows.Forms.DataGridTextBox

Code:
create you custom colums and tablestyles and add
 Dim theCol As DataGridTextBoxColumn
        theCol.TextBox.Multiline = True

Hope this helps
 
Thanks but I have already tried that plus
theCol.TextBox.WordWrap= True

but It still doesnt work

this is really a pain, ther must be some way to do it, I have searched everywhere for possible examples.

Does anybody know of an alternative to a datagrid that would allow me to do this.

Tahks again:-\
 
This is just a suggestion (I havent tried it). Try adding the following after the multiline statement.

dg.PreferredRowHeight = theCol.TextBox.Height
 
RE

you could try a listbox
binding to a listbox is tricky tho with the INSERT, UPDATE, DELETE routines
 
I would prefer to use a datagrid as I would have to learn the listbox and I have also got buttons in my grids.
I have long since tried the preferred height, but like the others to no avail. The only thing i get is taht when I click in the cell I get to see all the contents. Thsi si not sufficent as I need to be able to print it as well.

I have an example aplication that uses a 3rd party component but I do not want to use 3rd party components if at all possible, but this does show me that it does work, all I need now is to figure out how they did it.

Any further ideas.
 
Back
Top