Try adding this override to the renderer class to see if it will take care of this problem.
public override bool ReplaceText(string find, string replace, int rowIndex, int colIndex, GridFindTextOptions options, bool bSetCell)
{
bool wholeCell = (options & GridFindTextOptions.MatchWholeCell) != 0;
bool matchCase = (options & GridFindTextOptions.MatchCase) != 0;
GridStyleInfo style = Grid.Model[rowIndex, colIndex];
string text = style.FormattedText;
CultureInfo culture = style.GetCulture(true);
string text2 = text;
if (!matchCase)
{
find = find.ToLower(culture);
text2 = text.ToLower(culture);
}
bool found = false;
if (wholeCell)
{
found = find.Equals(text2);
if (found)
{
if (bSetCell)
{
CurrentCell.MoveTo(rowIndex, colIndex);
CurrentCell.BeginEdit();
CurrentCell.Renderer.ControlText = replace;
}
else
{
Grid.Model[rowIndex, colIndex].FormattedText = replace;
}
}
}
else
{
int index = text2.IndexOf(find.ToString());
if (index != -1)
{
found = true;
StringBuilder sb = new StringBuilder();
if (index > 0)
sb.Append(text.Substring(0, index));
sb.Append(replace);
index += find.Length;
int index2 = -1;
do
{
text2 = text.Substring(index);
if (!matchCase)
text2 = text2.ToLower(culture);
index2 = text2.IndexOf(find.ToString());
if (index2 != -1)
{
if (index2 > 0)
sb.Append(text.Substring(index, index2));
sb.Append(replace);
index += index2 + find.Length;
}
}
while (index2 != -1);
if (index < text.Length)
sb.Append(text.Substring(index));
if (bSetCell)
{
CurrentCell.MoveTo(rowIndex, colIndex);
CurrentCell.BeginEdit();
//CurrentCell.Renderer.ControlText = sb.ToString();
activeRichTextBox.Rtf = sb.ToString();
}
else
{
Grid.Model[rowIndex, colIndex].FormattedText = sb.ToString();
}
}
}
return found;
//return base.ReplaceText (find, replace, rowIndex, colIndex, options, bSetCell);
}
I do not have any further ideas on autosizing RTF. Exactly what is not working for you?