Trainee Posted December 14, 2021 Share Posted December 14, 2021 Hi, I have a dynamically created TUniDBGrid. It contains columns such as: ID, Date, Description. procedure TSynUniguiGrid.UniDBGridSelectionChange(Sender: TObject); var vRowID: Integer; begin if (sender is TControl) then begin vRowID := TUniDBGrid(Sender).CurrRow; end; if TUniDBGrid(Sender).SelectedRows.Count > 0 then begin // end; end; If I use CurrRow, I get the row number. Instead what I want is to just get the value in the ID column of that current row. How does one achieve that? Which demo provides an example? The ID is needed to create a TDataRequest later on. Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted December 14, 2021 Share Posted December 14, 2021 TUniDBGrid(Sender).DataSource.DataSet.FieldByName('ID').AsInteger; 1 Quote Link to comment Share on other sites More sharing options...
Trainee Posted December 14, 2021 Author Share Posted December 14, 2021 Thank you Oliver. You're a life saver. 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.