So while the grid doesn't support Column.Visible yet I tried a work around like this:
Procedure TMyForm.AddColumn;
var Col: TTMSFNCGridDatabaseAdapterColumn;
begin
GridAdapter.BeginUpdate;
Try
Col := GridAdapter.Columns.Add;
FColIndex := Col.Index;
Col.FieldName := 'AFieldName';
Col.Header := 'Col Title';
Finally
GridAdapter.EndUpdate;
End;
end;
And then
Procedure TMyForm.DeleteColumn;
begin
GridAdapter.BeginUpdate;
Try
GridAdapter.Columns.Delete(FColIndex);
Finally
GridAdapter.EndUpdate;
End;
end;
The first call works (although I have to set the column width). But the second call doesn't remove the column. I have tried various Update methods on the Grid but nothing seems to work.
Any ideas?
Thanks