Hi i have a dbgrid in multiselect mode but how do i do if i want instead of select one by one with CTRL,for example holding SHIFT and select a Range by the first to the last and making a selecion range.Thanks.
You have to add code to do this (most of the 3rd party grids already have it).
The hard part is figuring out where the beginning is. You can update a TBookmarkStr in the BeforeScroll event and then check for
Code:
(ssShift in Shift)
in the MouseDown event.
If the Shift is down, you have to figure out if the starting row is "up" or "down" (you can usually tell by the active index value). Save a bookmark to the current row.
Start moving through the TDataSet until TDataSet.Bookmark = StartingBookmark (saved from BeforeScroll). On each row you want to select, use
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.