Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
1.80/5 (3 votes)
hey ,

is it possible to set the cells of a DataGridView so if the content
of a cell is longer than a certain amount of chars ,
the cell will split the text into few lines as needed...

as for now i get cells with long lines and i didnt find any way
to adjust the cells as multiline cells , im sure there is a way of doing that.

what properties , methods would solve my problem?

thanks.

Posted
Updated 17-Nov-16 1:04am

Have you set the cells to wrap = true



 
Share this answer
 
VB
Public Sub Multi_LineGrid(ByRef List As DataGridView)
       List.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
       List.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
       List.DefaultCellStyle.WrapMode = DataGridViewTriState.True
   End Sub
 
Share this answer
 
SQL
SELECT tbl_persenel.name AS from_,tbl_persenel_1.name AS to_, tbl_Persen.nameP, tbl_rom = tbl_persenel.id INNER JOIN
           tbl_mian_crm ON tbl_detils_crm.id_crm = tbl_mian_crm.id ON tbl_project.id = tbl_mian_crm.id_project LEFT OUTER JOIN
          tbl_Persen ON tbl_mian_crm.user_id = tbl_Persen.id
 
Share this answer
 
Comments
Richard Deeming 17-Nov-16 9:36am    
This question was asked and answered over NINE YEARS AGO.

Your "solution" isn't even vaguely related to the question that was asked.


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900