wenz
wenz

Reputation: 169

How can I display all text in Cell of GridView

I use GridView in my C# application, and the cell seems too small. enter image description here

I find the prop of GridView, but I find nothing about it. How can I display all text in Cell?

Upvotes: 0

Views: 876

Answers (1)

Edper
Edper

Reputation: 9322

Under Columns Collection property there is AutoSizeMode under Layout. And use for example DisplayedCells and see for yourself.

For Word Wrap you could set it programmatically like:

// Columns[1] for 2nd column based on your example.
dataGridView.Columns[1].DefaultCellStyle.WrapMode = DataGridViewTriState.true;

But don't set the AutoSizeMode as above or else the columns will still expand.

You could set it also manually under Columns Collection property and under Appearance select Default Cell Style and then set WrapMode to true.

Upvotes: 1

Related Questions