

With the Ctrl button still down, click another row in the grid, then the button. This time the selected row appears in the ListBox. People spend hours of their day weeding through their.
#Delphi dbgrid export to pdf pdf
This time press and hold the Ctrl key while you click the grid then the button. case study mature marketing pdf Learner outcomes include improved ability to understand basic delphi dbgrid summary footer spoken utterances and vocabulary and to communicate in common situations by using basic language functions and the appropriate vocabulary with standard pronunciation. The reason is that clicking the button moves focus away from the DBGrid, so that as far as it is concerned, none of its rows is selected.

Click a row in the grid and then the button. Place a button on your form and in its OnClick handler call GetSelected.Ĭompile and run. In the Object Inspector, set the DBGrid Options property dgMultiSelect to True.

#Delphi dbgrid export to pdf code
If you are having trouble getting my code to work, try this: To clear the current selections, all you need do is to call its Clear method, like so: procedure TForm1.btnClearSelectedClick(Sender: TObject) Įqually, if you want to clear your ListBox, you just call its Clear method, as in: procedure TForm1.btnClearListBoxClick(Sender: TObject) The grid's selected rows are stored in a TBookmarkList named SelectedRow. You can set the current grid row as selected like this := True If >0 then beginįor i:=0 to -1 doĭataSet.GotoBookmark(Pointer()) As you can see, my use of a local DataSet variable instead involves minimal extra typing and avoids all sorts of accidental problems that can arise when you use with. The calls to DataSet.Disable/EnableControls and /EndUpdate are to speed the process up.Īlso, avoid the with construct like the plague. The main problems were the fact that you weren't correctly initialising s and your way of getting the fields for the selected row(s) was flawed. The code below fixes a few problems with yours.
