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);
}
KV
Karthik Vishnu R
Syncfusion Team
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:
http://www.syncfusion.com/uploads/redirect.aspx?file=resize_1d2b7471.zip&team=developmentWe 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
JW
Joe Ward
April 14, 2010 03:16 PM UTC
7.4.0.20
KV
Karthik Vishnu R
Syncfusion Team
April 16, 2010 04:22 AM UTC
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.