DataGridViewCellStyle.WrapMode Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating whether textual content in a DataGridView cell is wrapped to subsequent lines or truncated when it is too long to fit on a single line.
public:
property System::Windows::Forms::DataGridViewTriState WrapMode { System::Windows::Forms::DataGridViewTriState get(); void set(System::Windows::Forms::DataGridViewTriState value); };
public System.Windows.Forms.DataGridViewTriState WrapMode { get; set; }
member this.WrapMode : System.Windows.Forms.DataGridViewTriState with get, set
Public Property WrapMode As DataGridViewTriState
One of the DataGridViewTriState values. The default is NotSet.
The property value is not a valid DataGridViewTriState value.
The following code example illustrates the use of this property.
this.dataGridView1.DefaultCellStyle.WrapMode =
DataGridViewTriState.True;
Me.dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True
If WrapMode is False for a cell that contains text, the cell displays the text on a single line, and displays any embedded newline characters as box characters. If WrapMode is True for a cell that contains text, the cell displays newline characters as line breaks, but also wraps any lines that exceed the width of the cell.
Product | Versions |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: