Alessandro Posted March 19, 2018 Share Posted March 19, 2018 Hello... I have a uniDBGrid with some selected items. I want to do a routine to execute only the items marked on the Grid. In normal Delphi it has the command: For I to DBGrid1.SelectedRows.Count - 1 then if DBGrid1.SelectedRows.CurrentRowSelected = True then showmessage('ok'); But I did not find similar in uniGui. how do I do? Can anyone help? Thank you Solved... procedure TFm_Form.btSaveClick(Sender: TObject); var I: Integer; B : TBookmark; varAtualiza : boolean; begin varAtualiza := False; if Gr_Grade.SelectedRows.Count > 0 then begin DataSet.DisableControls; B := DataSet.GetBookmark; for I := 0 to Gr_Grade.SelectedRows.Count - 1 do begin (works) varAtualiza := True; end; end; if varAtualiza = True then begin uniMainModule.SQLTempo.Close; uniMainModule.SQLTempo.CommandText := 'update pokayoke a set a.situation = 0 where a.id=:id'; uniMainModule.SQLTempo.params[0].AsInteger := 1; uniMainModule.SQLTempo.ExecSQL; end; DataSet.EnableControls; close; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 19, 2018 Share Posted March 19, 2018 Hi, Sorry maybe I did not understand you correctly, but UniDBGrid ->.SelectedRows property already "includes" marked records Have you seen this demo for example?: \FMSoft\Framework\uniGUI\Demos\Desktop\GridMultiSelect Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 19, 2018 Share Posted March 19, 2018 If you mean the current selected record, then you can reference the DataSet I think... Quote Link to comment Share on other sites More sharing options...
Alessandro Posted March 19, 2018 Author Share Posted March 19, 2018 If you mean the current selected record, then you can reference the DataSet I think... Thanks... 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.