How to achieve Column wrapping in the WinForms GridControl?
WrapText
The Column wrapping is achieved by using the WrapText property. It is used to apply the wrap text style to a particular cell, column, or row.
By using the GridModel
this.gridControl1[0, 2].CellValue = "Wrap";
this.gridControl1.ColStyles[2].CellValue = " Wrapped text is shown";
// apply wrap text for the column
this.gridControl1.ColStyles[2].WrapText = true;this.gridControl1[0, 2].CellValue = "Wrap";
Me.gridControl1.ColStyles(2).CellValue = "Wrapped text is shown"
' apply wrap text for the column
Me.gridControl1.ColStyles(2).WrapText = TrueBy using the QueryCellInfo event
void gridControl1_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
{
if (e.ColIndex == 2 && e.RowIndex>0)
{
// apply wrap text for the column
e.Style.WrapText = true;
e.Style.CellValue = "Wrapped Text is Shown";
}
}Private Sub gridControl1_QueryCellInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs)
If e.ColIndex = 2 AndAlso e.RowIndex > 0 Then
' apply wrap text for the column
e.Style.WrapText = True
e.Style.CellValue = "Wrapped Text is Shown"
End If
End SubNote:
By default,
the WrapText is set to true for all the columns.
The following screenshot displays the Column wrapping in GridControl.

Samples:
C#: ColumnWrapping
VB: ColumnWrapping
Conclusion
I hope you enjoyed learning about how to achieve Column wrapping in the WinForms GridControl.
You can refer to our WinForms GridControl feature tour page to know about its other groundbreaking feature representations and WinForms GridControl documentation, and how to quickly get started for configuration specifications.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!