Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

One of data fields in my window form datagrid contains a long text (200 characters). How can I make each field in that specific datagrid column contain more than one line of text ? I would appreciate it if anyone can help me with this.

 

Thanks. :)

Posted

Good luck in finding a solution to this without writing ypur own datagrid control. If you delve into the datagridcolumstyles and look at the datagridtextboxcolumn you will see that like the normal text box it has multiline etc.. parameters. They do not seem to work as the row will be limited to the preferredrow height. You can change the preferredrowheight but this will only change the height for all the rows, and this is probably not what you want to do. There is no method that allows you to change an individual row height (or none that I have found.)

Thus unless somebody has solved this problem you need to either buy an external 3rd party component (not always possible) or write your own datagrid control using textboxes or labels etc... (not as difficult as you may think it is to do this)

 

Sorry for no easy solution to your problem.)

Hamlet
Posted

Dear Hamlet,

I tried this code and it is not working. Any suggestion?

 

Thanks.

 

Dim grdTBSt as DataGridTableStyle

Dim grdTBC as DataGridTextBoxColumn

Dim dTB As DataGridTextBox

dTB = CType(grdTBC.TextBox, DataGridTextBox)

dTB.Multiline = True

grdTBSt.GridColumnStyles.Add(grdTBCProc)

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