When the RadGridView AutoSize property is set to true and a row is expanded, an exception is thrown:
System.InvalidOperationException: 'MeasureOverride returned positive infinity: Telerik.WinControls.UI.GridDetailViewRowElement'
A possible workaround is to replace the GridDetailViewRowElement with your own class. Then overriding the MeasureOverride method we can pass valid size to the element.
private void RadGridView1_CreateRow(object sender, GridViewCreateRowEventArgs e)
{
if (e.RowInfo is GridViewDetailsRowInfo)
{
e.RowElement = new MyGridDetailViewRowElement();
}
}
public class MyGridDetailViewRowElement : GridDetailViewRowElement
{
protected override SizeF MeasureOverride(SizeF availableSize)
{
var baseSize = base.MeasureOverride(availableSize);
if(baseSize.Width == float.PositiveInfinity)
{
baseSize.Width = 800;
}
return baseSize;
}
}