Datagrid and row heigth

stordaz

Newcomer
Joined
Apr 15, 2003
Messages
16
Location
Italy
Is it possible, while filling a datagrid, changing the row heigth
according to the text (e.g. multiline text)?
Sorry b
ut searching the forum I've found no answer.

Thanks
stefano
 
Well, I see two solutions :

- You specify a PreferredRowHeight to your datagrid and so you will be able to have bigger rows (but even if it is not needed)

- You implement a custom GridColumnStyle, and in the constructor, you specify me.TextBox.Multiline = true
Of course you will also have to create your custom DataGridtableStyle to use a custom editor that will allow you to choose your new GridColumnStyle at designe time
And you will also have to create you custom datagrid to use a custom editor to choose your new table Style
However, it is quite quick to do.
I have not tested, so I don't know if that solution work.
If you need an exemple to create your own GridColumnStyle and editors, here is a good link :
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q1020q
 
I tried to set TextBox.Multiline = true but it doesn't change the height of my row...

Anyway thanks for your hint, Jarod. I think I need to study a lot about this datagrid..
 
The PreferredRowHeight will give you bigger boxes but will not give you wordwrap. I have been trying to solve this for a while but havent managed it. I know it works because I have a 3rd party component that does it but I need to be able to do it myself. If you have solved it please let me know.
 
Hi Hamlet,
I've not found any solution for this problem for now but sooner or later I will need it.
Try to ask me again in the next few months... I hope I can help you too.
 
stordaz said:
Hi Hamlet,
I've not found any solution for this problem for now but sooner or later I will need it.
Try to ask me again in the next few months... I hope I can help you too.

Were any of you able to find out how to make a multiline column? I searched through Google, but did not find any useful info. If you know something about this, please let us know.

Thanks in advance.
 
Back
Top