Hi TMS,
I have a problem when I use "AdvStringGrid.ComboBox.AutoDropDown = True" and "AdvStringGrid.Options.GoTabs = True".
I have 2 column in the middle of my grid that use "Editor = edComboList". When I use "Tabs" to move in the grid :
- when I enter the first column, combo "no dropdown"
- when I enter the second column, combo "dropdown auto"
- when I exit the second column, combo of the second column "dropdown" and "disable"
If I remove the options "goTabs", it works. But I want my user to see the "dropdown auto".
Is there any way to do this ?
Thank you!
You can reach this with a built-in TAdvStringGrid feature grid.MouseActions.DirectComboDrop
Example:
procedure TForm1.AdvStringGrid1GetEditorProp(Sender: TObject; ACol,
ARow: Integer; AEditLink: TEditLink);
begin
if acol in [2,3] then
begin
AdvStringGrid1.ClearComboString;
AdvStringGrid1.AddComboString('item A');
AdvStringGrid1.AddComboString('item B');
AdvStringGrid1.AddComboString('item C');
end;
end;
procedure TForm1.AdvStringGrid1GetEditorType(Sender: TObject; ACol,
ARow: Integer; var AEditor: TEditorType);
begin
if acol in [2,3] then
AEditor := edComboList
else
AEditor := edNormal;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
AdvStringGrid1.DefaultEditor := edComboList;
AdvStringGrid1.MouseActions.DirectComboDrop := true;
AdvStringGrid1.Options := advstringgrid1.Options + [goTabs,goEditing];
end;
Hi Bruno,
Thank you, I just test it and it works.