Board index » delphi » Using DBGrid dgMultiselect

Using DBGrid dgMultiselect

Is there any way to programmatically set which rows are selected.  For
example, I want to select all of the records with a button.  Also, SHIFT
+ CLICK does not seem to work.  CTRL + CLICK does, though.  Why is
this?  Can I program the control to do this?  I can't seem to find any
help on programmatically setting the selected rows or I would program
the control to operate this way.  Any help would be appreciated.  I'm
using Delphi 3 with Interbase 5.

Sean McElroy

 

Re:Using DBGrid dgMultiselect


Quote
>Can I program the control to do this?  I can't seem to find any
>help on programmatically setting the selected rows or I would program
>the control to operate this way.

The Grid has a SelectedRows property.  This is a Tbookmarklist of all of the
rows selected in the grid.   for the current  row in the grid there is a
CurrentRowSelected propery which is true if the row is in the SelectedRows
(tbookmarkList)

You can also set the CurrentRowSelected property which is what you do to
programatically select a row

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Other Threads