We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I size my column widths or row heights so that the entire text in a cell is visible?

Platform: WinForms |
Control: GridControl |
Published Date: April 30, 2011 |
Last Revised Date: April 13, 2015

To resize the columns for the text to be visible, you can use the grid.Model.ColWidths.ResizeToFit method. This method takes two arguments, the GridRangeInfo object that specifies the cells to be resized and the GridResizeToFitOptions setting that specifies certain behaviors. The last setting controls whether to allow the shrinking of the cell when it is resized and whether to include any header cell in the resizing.

To resize the row heights, you can use the grid.Model.RowHeights.ResizeToFit method.

C#

VB

Resizing the entire grid with large grids can be time consuming. To resize only the visible areas of the grid, you can set the range argument to the grid.ViewLayout.VisibleCellsRange.

In the following image, the ResizeToFit is applied to the second column and 1 to 5 rows.

Sample Links:

Resize-C#

Resize-VB

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
Comments
LaTina Washington
Apr 09, 2015
I clicked on the link above, and the web page was not available. Reply
Mahendran Annamalai [Syncfusion]
Apr 13, 2015
We have modified the article and the provided link. You can download the sample now.

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.