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

Question about ResizeRowsToFit

Thread ID:





93891 Apr 9,2010 01:45 PM UTC Apr 16,2010 04:22 AM UTC WPF 3
Tags: GridControl
Joe Ward
Asked On April 9, 2010 01:45 PM UTC

In our grid, we are hiding the top row by setting its height to 0 and we also call SetHidden( 0, 0, true). However, some of our cells have text that is too long, as in the example below. We then called ResizeRowsToFit() at the end of our constructor. However, ResizeRowsToFit() does not work after calling SetHidden OR setting a row height to 0 - ResizeRowsToFit() must be called first. However, if you were to just set a row height to 500, not call SetHidden, but then call ResizeRowsToFit()... it works fine.

So, setting a row height to 0, or calling SetHidden, or doing both before calling ResizeRowsToFit, causes the long text to still be chopped off. Is this a bug or does ResizeRowsToFit() work differently than I'm expecting?

public Window1()
this.grid.Model.RowCount = 10;
this.grid.Model.ColumnCount = 10;

for (int i = 0;i < 10;i++)
for (int j = 0;j < 10;j++)
var style = this.grid.Model[i, j];
style.CellValue = string.Format("Cell {0} / {1}", i, j);

//Should these two lines really cause ResizeRowsToFit on line 49 to not work?
this.grid.Model.RowHeights[0] = 0;
this.grid.Model.RowHeights.SetHidden(0, 0, true);

this.grid.Model[7, 7].Text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";

this.grid.Model.ResizeRowsToFit(GridRangeInfo.Cols(0, 13), GridResizeToFitOptions.IncludeCellsWithinCoveredRange);

Karthik Vishnu R [Syncfusion]
Replied On April 13, 2010 01:56 PM UTC

Hi Joe,

We prepared a test sample with the code you have sent us. ResizeRowsToFit works with the expected result. You can download the following snapshot for reference:


We would like to know which version of Essential Studio you are using because this might be an issue in our old versions.

Please let us know.


Joe Ward
Replied On April 14, 2010 03:16 PM UTC

Karthik Vishnu R [Syncfusion]
Replied On April 16, 2010 04:22 AM UTC

Hi Joe,

Thanks for the detail. We prepared a sample and checked your code with version and we were able to reproduce the issue. Please create a DirectTrac Incident with this forum title. We will update you with a patch that will resolve this issue.

Let us know if you need more details.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

Warning 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.Close Icon