Hello!
Something wrong with your code sample.
For example, what about DataSource and Parent for your Grid?
I wrote code to check your question and my code works perfectly:
Code:
procedure TForm1.FormShow(Sender: TObject);
var
i : Integer;
sDBGrid: TsDBGrid;
begin
sDBGrid := TsDBGrid.Create(Self); // Create sDBGrid instance
sDBGrid.Parent := Self; // Grid will be placed on Form1
sDBGrid.DataSource := dsApps; // dsApps is TDataSource component created in design-time and linked to TClientDataSet instance
sDBGrid.Columns.Clear; // Clear columns for sure
cdsApps.Open; // Activate our dataset
for i := 0 to cdsApps.FieldCount – 1 do
Begin
sDBGrid.Columns.Add;
sDBGrid.Columns.Field := cdsApps.Fields;
sDBGrid.Columns.FieldName := cdsApps.Fields.FieldName;
sDBGrid.Columns.Title.Caption := cdsApps.Fields.DisplayLabel + '_test'; // “_test” suffix placed here to
// view difference between default column title values
End;
end;
So, it seems that your question not related with AlphaControls directly, because your sample above will not works with any DBGrid.