Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

Jarod
Posted

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..

  • 1 month later...
Posted
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.
Hamlet
Posted

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.

  • 1 year later...
Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...