Datagridview cell wrap text

Answered
0
0

How do I get the texts within a datagridview cell to wrap texts?

I’m using VB, but C# works fine 🙂

  • You must to post comments
Best Answer
0
0

In order to enable text wrapping in a DataGridView, you can set the WrapMode of the cell style to true. By default the WrapMode will be “NotSet,” which will cause the cells to act as if it were false.

dataGridViewName.DefaultCellStyle.WrapMode = DataGridViewTriState.True;

I would also recommend using auto sizing on your rows depending on how much text you plan on having wrapped.

 

Hope this helps,

Lawrence

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.