robinhodemorais Posted December 3, 2019 Share Posted December 3, 2019 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 3, 2019 Share Posted December 3, 2019 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? Quote Link to comment Share on other sites More sharing options...
robinhodemorais Posted December 3, 2019 Author Share Posted December 3, 2019 4 hours ago, Sherzod said: Sorry, can you please explain in more details? is attached DemoGridCombo.rar Quote Link to comment Share on other sites More sharing options...
robinhodemorais Posted December 3, 2019 Author Share Posted December 3, 2019 need help Quote Link to comment Share on other sites More sharing options...
belo Posted December 4, 2019 Share Posted December 4, 2019 Do you want to return the text on the field? Quote Link to comment Share on other sites More sharing options...
robinhodemorais Posted December 4, 2019 Author Share Posted December 4, 2019 yes Quote Link to comment Share on other sites More sharing options...
belo Posted December 4, 2019 Share Posted December 4, 2019 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 Quote Link to comment Share on other sites More sharing options...
robinhodemorais Posted December 4, 2019 Author Share Posted December 4, 2019 the first answered perfectly, the second really gave error List the index off limits (-1). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.