Hello,
we have recently updated the component TDBAdvGrid to version 2.4.2.5. After this update some of our applications begin to throw exceptions when using ColumnByFieldName property. After analysing the error we discovered that the property has changed and is not working fine.
We commented the GroupColumn section, because we think it's not necessary:
function TDBAdvGrid.GetColumnByFieldName(AValue: string): TDBGridColumnItem;
var
i: Integer; //,idx
begin
Result := nil;
i := 0;
//idx := 0;
while i < Columns.Count do
begin
if (StrIComp(PChar(Columns.Items.FieldName), PChar(AValue)) = 0) then
begin
Result := Columns.Items;
//idx := i;
Break;
end;
inc(i);
end;
{if (GroupColumn <> -1) then
begin
if (idx >= GroupColumn) and (idx > 0) then
Result := Columns.Items[idx - 1];
end;}
end;
We group by a column, but once the while has found the right column matching with the FieldName there's no need to decrease the index.