Question off topic: How to upload pictures to this forum?< ="text/" id="Video_Control_settings">.Video_Control,null,video,null{filter: contrast(100%)brightness(100%)saturate(100%)sepia(0%) url(#Sharpen0) url(#MIRROR0) url(#Video_Control_Gamma) !important;transition: 0.5s;}
Is it not compiling or just the code completion? Could you try DBGridEh1.Columns.Items[0].FieldName?
< ="text/" id="Video_Control_settings">.Video_Control,null,video,null{filter: contrast(100%)brightness(100%)saturate(100%)sepia(0%) url(#Sharpen0) url(#MIRROR0) url(#Video_Control_Gamma) !important;transition: 0.5s;}
Could you please contact us through e-mail sending the test project you built and providing the steps to reproduce? Here we can simply access the Columns and FieldName properties.
I send e-mail. With DBGrid i can access the Columns and FieldName properties, but try with DbGridEh and i can't.
Another question. The construction is of the form TDBGrid (sender). is not supported by the code inspector ?
[QUOTE=Semenova Alena]Another question. The construction is of the form TDBGrid (sender). is not supported by the code inspector ?
Another question:
Unfortunately not, that's the grid behavior, those columns are the dynamic ones generated. Like in Delphi, you must explicitly create the grid columns for persistence.
May be you can make a button (like in delphi) add all fields from the data set ?
The "Add All Fields" option already exists for the dataset. We're talking about grid columns, which doesn't have that option even in Delphi.
In Delphi this option present.
Ok. We have implemented this internally and it will be available in next version.
Ok.Thank
Wow, super! http://imageshack.com/i/pmeavQZfp
You can use this code:
{ TDBGridIDEEditor}
type
TDBGridIDEEditor = class(TIDEComponentEditor)
protected
procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): string; override;
function GetVerbCount: Integer; override;
end;
procedure TDBGridIDEEditor.ExecuteVerb(Index: Integer);
var
I: Integer;
DataSource: TDataSource;
Grid: TDBGrid;
begin
if Index <> 0 then Exit;
Grid := TDBGrid(GetComponent);
case MessageDlg('Delete existing columns before adding the new ones?', mtConfirmation,
[mbYes, mbNo, mbCancel], 0) of
mrCancel: Exit;
mrYes: Grid.Columns.Clear;
end;
Datasource := Grid.DataSource;
if (DataSource <> nil) and (DataSource.DataSet <> nil) then
with Datasource.Dataset do
begin
Grid.Columns.BeginUpdate;
try
for I := 0 to FieldList.Count-1 do
Grid.Columns.Add.FieldName := FieldList.FullName;
finally
Grid.Columns.EndUpdate;
end;
end;
end;
function TDBGridIDEEditor.GetVerb(Index: Integer): string;
begin
case Index of
0: result := 'Add All Fields to Columns...';
end;
end;
function TDBGridIDEEditor.GetVerbCount: Integer;
begin
result := 1;
end;
RegisterIDEComponentEditor(TDBGridEh, TDBGridIDEEditor);
Thank