Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS Advanced Dropdown Controls
How to setup a default TAdvColumnGrid with 2 columns, data for columns and retrieve selected value & index

This code snippet shows how to setup a default TAdvColumnGrid with 2 columns, data for columns and retrieve selected value & index:
procedure TForm1.Button1Click(Sender: TObject); 
begin
  showmessage(  IntToStr(AdvMultiColumnDropDown1.ItemIndex) + ':'+ AdvMultiColumnDropDown1.Text); 
end;

procedure TForm1.FormCreate(Sender: TObject); 
begin
  AdvMultiColumnDropDown1.Columns.Clear;
  AdvMultiColumnDropDown1.Columns.Add;
  AdvMultiColumnDropDown1.Columns.Add;
  AdvMultiColumnDropDown1.Columns[0].Header := 'Col 1';
  AdvMultiColumnDropDown1.Columns[1].Header := 'Col 2';

  AdvMultiColumnDropDown1.Items.Clear;
  AdvMultiColumnDropDown1.Items.Add.Text.CommaText := 'A,1';
  AdvMultiColumnDropDown1.Items.Add.Text.CommaText := 'B,2';
  AdvMultiColumnDropDown1.Items.Add.Text.CommaText := 'C,3';
  AdvMultiColumnDropDown1.Items.Add.Text.CommaText := 'D,4'; 
end;

Result: