infmtx Posted August 27, 2003 Posted August 27, 2003 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. :) Quote
donnacha Posted August 29, 2003 Posted August 29, 2003 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.) Quote Hamlet
infmtx Posted August 29, 2003 Author Posted August 29, 2003 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) Quote
infmtx Posted August 29, 2003 Author Posted August 29, 2003 I forgot to tell you that what I need is each row in a datagrid has two-line space. Quote
donnacha Posted September 5, 2003 Posted September 5, 2003 the Multiline field does not seem to work, I don;t thing any of the built in functionality will help to get a multi-line grid. Sorry Quote Hamlet
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.