Absolutely interesting. Well, now we are talking. I add extra 20 pixels for graphics in the beginning of certain columns; when in CustomDrawCell() event. column.BestFit() don't know about this extra space; thereby cutting the last 20 pixels of the end of text. If I could somehow tell the BestFit() method that I want it to prefix with 20 pixels; the BestFit() algorithm could use this info to correctly fit the cell width. The interface could be something as simple as column.BestFit(int WidthExtention = 0).
GridControl - How to change the BestFit algorithm
Answers
As a quick fix, you can simply loop through all of the columns in your View, get the BestFit size, add 20 pixels, and set the ColumnWidth property. For instace:
C#private void MyBestFit(int ColumnPadding)
{
int BestColumnWidth = 0;
foreach (GridColumn column in gridView1.VisibleColumns)
{
BestColumnWidth = gridView1.CalcColumnBestWidth(column);
column.Width = (BestColumnWidth + ColumnPadding);
}
}
And then, simply call that method instead of the GridView's BestFitColumns method.