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.
Unfortunately, activation email could not send to your email. Please try again.

Question about ResizeRowsToFit

Thread ID:

Created:

Updated:

Platform:

Replies:

93891 Apr 9,2010 09:45 AM Apr 16,2010 12:22 AM WPF 3
loading
Tags: GridControl
Joe Ward
Asked On April 9, 2010 09:45 AM

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()
{
InitializeComponent();
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 09:56 AM

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:

http://www.syncfusion.com/uploads/redirect.aspx?file=resize_1d2b7471.zip&team=development

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.

Regards,
Karthik

Joe Ward
Replied On April 14, 2010 11:16 AM

7.4.0.20

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

Hi Joe,

Thanks for the detail. We prepared a sample and checked your code with version 7.4.0.20 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.


CONFIRMATION

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.

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.

;