Hi Francesco,
In your TextBoxModel class, you need to override CalculatePreferredCellSize, and in your override return the proper size for your cell based on the information passed in. This is the method that grid.Model.ColWidths.ResizeToFit and grid.Model.RowHeights.ResizeToFit calls to get the values it uses to determine the sizes. Below is a code snippet
public override Size CalculatePreferredCellSize(Graphics g, int rowIndex, int colIndex, GridStyleInfo style, GridQueryBounds queryBounds)
{
Size size = g.MeasureString(style.Text,style.GdipFont).ToSize();
return size;
}
Modified sample :
http://www.syncfusion.com/Support/user/uploads/ResizeToFitTest_f6d5bbab.zipThanks,
Haneef