Hi,
I use Delphi 7 with ODAC 5.80.0.41 Net and Oracle 10.2.0.3.
I encountered a problem of very slow repainting of CR grid columns containing long strings (specific long strings, not any ones).
I believe, though not sure, that some combination of chr(10) characters inside the text causes the problem.
Another condition that might affect this slow repainting is physical adding columns into the Columns property of the CR grid and then reducing the width of the column containing this long varchar text, but sometimes I receive this bug when there are no columns at all, in other words, when the grid creates columns according to dataset fields.
In addition there is another small display problem in the CR grid:
"enter" characters (chr(10) and chr(13)) are displayed as some garbage inside a grid column. In my case I see some Hebrew letters – I think this is because my "Language for non-Unicode programs" in the Regional Settings is Hebrew. When I set it to Russian, I see '::' in place of 2 Hebrew letters.
Please tell me when you are going to fix these problems.
Thanks,
Yevgeny
P.S. I sent a test project where this problem can be reproduced along with the script for creating the table with problematic long texts to support()crlab.com.
Long strings displayed in a grid column problem
I fixed the bug.
The problem was in drawing 3 dots ('...') in the end of a string column when the text is longer than the column can display according to its current width.
The problem is in TCRDBGrid.DrawColumnCel method.
The problematic code is:
I changed it to this one:
I am using WideCanvasTextWidth because my CR grid supports Unicode.
The line 'if (Value[j] Chr(10)) and (Value[j] Chr(13)) and (Value[j] UnicodeEOL)' fixes another display bug I mentioned in the original post (UnicodeEOL = #$0D#$0A).
The problem was in drawing 3 dots ('...') in the end of a string column when the text is longer than the column can display according to its current width.
The problem is in TCRDBGrid.DrawColumnCel method.
The problematic code is:
Code: Select all
while (TextWidth > ColWidth) and (Length(Value) > 1) do begin
SetLength(Value, Length(Value) - 1);
TextWidth := Canvas.TextWidth(Value) + TextMargin + ThreeDotWidth;
end
Value := Value + ThreeDot;Code: Select all
prev_s := Value;
for j := 1 to Length(Value) do
begin
if (Value[j] Chr(10)) and (Value[j] Chr(13)) and (Value[j] UnicodeEOL) then
s := s + Value[j]
else
s := s + ' ';
TextWidth := WideCanvasTextWidth(Canvas, s) + TextMargin + ThreeDotWidth;
if TextWidth >= ColWidth then
begin
Value := prev_s + ThreeDot;
Break;
end;
prev_s := s;
end;The line 'if (Value[j] Chr(10)) and (Value[j] Chr(13)) and (Value[j] UnicodeEOL)' fixes another display bug I mentioned in the original post (UnicodeEOL = #$0D#$0A).