This is a migrated thread and some comments may be shown as answers.

Problem with AutoSizeRows

1 Answer 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ye
Top achievements
Rank 1
ye asked on 27 Mar 2014, 01:30 PM
Hi,

I am facing a problem and I cannot find a solution for it. I set the AutoSizeRows to true for a RadGridView. The grid has many columns (about 20 columns). When I scroll the grid horizontally, the height of rows will recalculated. Suppose, the first column in the first row has 5 lines, the grid computes the height of the first row and set it to 150 px , when I scroll to see the last column of the first row the height of this row will become 50 px. So sometime the height of the first row is 150px sometimes it is 50px (it depends on which cells are shown on the screen) I hope that you get what I am facing and can give me a solution for it.

Regards,
Ye

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Apr 2014, 09:00 AM
Hello Ye,

Thank you for writing.

When the RadGridView.AutoSizeRows property is set to true, the row height will expand for multiline cell text, depending on the currently visible cells. When you scroll horizontally, the row height will be adjusted according to the newly displayed cells. This is desired behavior of the row auto size functionality.

However, if this default behavior is not suitable for your specific case, you can use the RowFormatting event and adjust manually the e.RowElement.RowInfo.MinHeight and e.RowElement.RowInfo.MaxHeight.

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
GridView
Asked by
ye
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or