I have a grid view with several columns that have text wrap turned on. AutoSizeRows is on. To set the row heights I am using the workaround described here. This works well for all rows that are initially visible.
1.
However, whenever I scroll down to other rows, the newly visible rows are displayed with incorrect row heights even though their height has been calculated correctly upon cell creation.
2.
Also I am not finding a way to force a row resize after cell contents have changed (e.g. long text entered).
Is there a way to force a row resize, e.g. hooked up to CellFormatting? Is there a timeline for implementing the AutoSizeRows enhancements that have previously been mentioned?
Thanks & kind regards
Frank
1.
However, whenever I scroll down to other rows, the newly visible rows are displayed with incorrect row heights even though their height has been calculated correctly upon cell creation.
2.
Also I am not finding a way to force a row resize after cell contents have changed (e.g. long text entered).
Is there a way to force a row resize, e.g. hooked up to CellFormatting? Is there a timeline for implementing the AutoSizeRows enhancements that have previously been mentioned?
Thanks & kind regards
Frank
9 Answers, 1 is accepted
0
Hi frank,
Thank you for contacting us.
Regarding your questions:
1. I was not able to reproduce this issue with our latest release - Q3 2008 SP1. Maybe it is specific to your application. Could you, please send us a sample application that reproduces the issue. I will be glad to help you solving this problem.
2. Yes, you can force a row to resize in height when processing the CellFormatting event. Consider the code snippet below:
I hope this helps. Do not hesitate to write us if you have other questions.
Greetings,
Jack
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thank you for contacting us.
Regarding your questions:
1. I was not able to reproduce this issue with our latest release - Q3 2008 SP1. Maybe it is specific to your application. Could you, please send us a sample application that reproduces the issue. I will be glad to help you solving this problem.
2. Yes, you can force a row to resize in height when processing the CellFormatting event. Consider the code snippet below:
void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) |
{ |
GridDataCellElement cell = e.CellElement as GridDataCellElement; |
if (e.CellElement.RowElement is GridDataRowElement && cell.Value.ToString().Length > 50) |
{ |
e.CellElement.RowInfo.Height = 150; |
} |
} |
I hope this helps. Do not hesitate to write us if you have other questions.
Greetings,
Jack
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Frank
Top achievements
Rank 1
answered on 13 Jan 2009, 09:14 AM
Hi Jack,
1.
thank you for looking into this. I have prepared a small sample project (here) that demonstrates the undesired behaviour.
2.
My question should have been more precise: What I meant to ask is "is it possible to recalculate the required height of the to-be-painted row and set it accordingly". However, if we get #1 solved, the need for this recalculation disappears.
I am on Q3 2008 SP1.
Much looking forward to your reply.
Thanks
Frank
1.
thank you for looking into this. I have prepared a small sample project (here) that demonstrates the undesired behaviour.
2.
My question should have been more precise: What I meant to ask is "is it possible to recalculate the required height of the to-be-painted row and set it accordingly". However, if we get #1 solved, the need for this recalculation disappears.
I am on Q3 2008 SP1.
Much looking forward to your reply.
Thanks
Frank
0

Frank
Top achievements
Rank 1
answered on 14 Jan 2009, 12:05 PM
Upont further investigation I have found that the problem (see my sample project) partially disappears if the GridView is set to AllowColumnResize=False AND AllowRowResize=False. Only then all rows have the proper heights and keep the proper height during scrolling provided scrolling is done row by row, i.e. by clicking the up/down arrow glyphs. If scrolling is done with the scroll bar slider, row heights are shown incorrectly once I scroll back up again.
So there seem to be two issues/questions:
1. How to get/maintain correct row heights if AllowColumnResize is allowed
2. Why does scrolling via scroll bar behave differently from scrolling line-by-line?
Grateful for any pointers how to fix this,
kind regards
Frank
So there seem to be two issues/questions:
1. How to get/maintain correct row heights if AllowColumnResize is allowed
2. Why does scrolling via scroll bar behave differently from scrolling line-by-line?
Grateful for any pointers how to fix this,
kind regards
Frank
0
Hi frank,
Thank you for sending your application - it helped me understand the issue. Please call InvalidateMeasure method for the desired cell so that it is resized. Hence, please add the following code in FixedGridDataCellElement:
The code snippet invalidates the row layout every time the cell value is changed which due to UI virtualization happens when you scroll in the grid.
Should you have any further questions, feel free to contact me.
Kind regards,
Jack
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thank you for sending your application - it helped me understand the issue. Please call InvalidateMeasure method for the desired cell so that it is resized. Hence, please add the following code in FixedGridDataCellElement:
Protected Overrides Sub SetContentCore(ByVal value As Object) |
MyBase.SetContentCore(value) |
Me.InvalidateMeasure() |
End Sub |
The code snippet invalidates the row layout every time the cell value is changed which due to UI virtualization happens when you scroll in the grid.
Should you have any further questions, feel free to contact me.
Kind regards,
Jack
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Frank
Top achievements
Rank 1
answered on 15 Jan 2009, 03:06 PM
Hi Jack,
thank you for analyzing this problem. Your suggestion does indeed seem to alleviate the problem to some extent, but the beast is still there. I have found the follwing to be reproducable:
Upon scrolling down (line by line), the 5th and 7th "new" row get wrong row heights (too high). Always exactly 5 and 7.
Upon scrolling up (line by line), the 4th and 6th "old"/visible row get wrong row heights (too high).
I have tried this with different data, so it is doesn't seem to be a data issue. I realize it sounds rather strange, but this is what's actually happening.
Thanks for bearing with me
regards
Frank
thank you for analyzing this problem. Your suggestion does indeed seem to alleviate the problem to some extent, but the beast is still there. I have found the follwing to be reproducable:
Upon scrolling down (line by line), the 5th and 7th "new" row get wrong row heights (too high). Always exactly 5 and 7.
Upon scrolling up (line by line), the 4th and 6th "old"/visible row get wrong row heights (too high).
I have tried this with different data, so it is doesn't seem to be a data issue. I realize it sounds rather strange, but this is what's actually happening.
Thanks for bearing with me
regards
Frank
0
Accepted
Hi frank,
Thank you for these details.
Currently there is no work around for this issue. We will try to address it for the upcoming service pack - 2008 Q3 SP2. Do not hesitate to write me, if you have other questions.
Best wishes,
Jack
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thank you for these details.
Currently there is no work around for this issue. We will try to address it for the upcoming service pack - 2008 Q3 SP2. Do not hesitate to write me, if you have other questions.
Best wishes,
Jack
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Frank
Top achievements
Rank 1
answered on 16 Jan 2009, 10:46 AM
Hi Jack,
OK, so I'll eagerly wait for SP2.
in any case thank you very much for your support
Kind regards
Frank
OK, so I'll eagerly wait for SP2.
in any case thank you very much for your support
Kind regards
Frank
0

Bill
Top achievements
Rank 1
answered on 26 Oct 2009, 04:54 PM
Telerik:
Did this get resolved? I'm using the 2009.2.9.701 version of the grid. I bind the grid to a dataTable, add two command columns, set AutoSizeRows = true, and it looks fine. However if you scroll down, the appropriate row heights get lost. Ideas? Thx...
Did this get resolved? I'm using the 2009.2.9.701 version of the grid. I bind the grid to a dataTable, add two command columns, set AutoSizeRows = true, and it looks fine. However if you scroll down, the appropriate row heights get lost. Ideas? Thx...
0
Hello Bill,
Yes, this scenario should work with our latest release - Q2 2009 SP1. However, it is possible that we missed some cases. So, please update your version with the latest one. If the issue appears again, send us your application and we will try to address the issue for the upcoming release in November.
I am looking forward to your reply.
Best wishes,
Jack
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Yes, this scenario should work with our latest release - Q2 2009 SP1. However, it is possible that we missed some cases. So, please update your version with the latest one. If the issue appears again, send us your application and we will try to address the issue for the upcoming release in November.
I am looking forward to your reply.
Best wishes,
Jack
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.