Class: TEgFireGridColumns
function Add: TEgFireGridColumn;
Adds a new column at the end of the collection and returns it. The
new column has no field and no title: set its FieldName
(which also sets its title) and whatever else it needs.
Adding the first column to the grid’s Columns replaces
the default columns: from then on the grid shows only the columns of the
collection.
Grid1.Columns.BeginUpdate;
try
with Grid1.Columns.Add do
begin
FieldName := 'Name';
Width := 180;
end;
with Grid1.Columns.Add do
begin
FieldName := 'Price';
DisplayFormat := '#,##0.00';
end;
finally
Grid1.Columns.EndUpdate;
end;