I need something like BesFitColumns() for rows. I know that I can use AutoSizeRows, but it has problem with cells that have long multiline content. I attached screenshot. Please check it.
1 Answer, 1 is accepted
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Nov 2015, 02:44 PM
Hello Mohsen,
Thank you for writing.
Due to UI virtualization in RadGridView, auto-size rows mechanism takes into consideration the currently visible cells. That is why when a multiline text is not visible, the row's height is small, but when you show the multiline text while scrolling, the height is adjusted to display the whole cell's content. This is normal behavior. However, you can turn off the auto-size mechanism and measure all cells in a row in order to determine the row's height considering all cells(including the invisible ones as well). You can find below a sample implementation:
GridVirtualizedCellElement virtualizedCell = cell as GridVirtualizedCellElement;
if (virtualizedCell != null)
{
cellProvider.CacheElement(virtualizedCell);
virtualizedCell.Detach();
rowElement.Children.Remove(cell);
}
else
{
cell.Dispose();
}
}
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items