Jump to content

how to get the selected value from a dbgrid combo box


robinhodemorais

Recommended Posts

6 hours ago, robinhodemorais said:

How do I get the selected value of combobox when I edit a value in the grid, I need to get the moment I select, already tried by combobox OnSelect and change more did not work.

Sorry, can you please explain in more details?

Link to comment
Share on other sites

Maybe this can help you..

procedure TMainForm.UniDBGrid1SetCellValue(Sender: TObject; ACol, ARow: Integer;
  AField: TField; var Value: Variant);
begin
  if AField = FDMemTable1.FieldByName('combo1') then
  ShowMessage(Value);
end;

 

// The correct would be this code work
procedure TMainForm.UniComboBox1Select(Sender: TObject);
begin
  ShowMessage(TUniComboBox(Sender).Items[TUniComboBox(Sender).ItemIndex])
end;

sds

Eduardo Belo

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...