Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Muhammed Shafraz
  Where is Muhammed Shafraz?
 Colombo
 Sri Lanka
 Muhammed Shafraz
 To: Chris Chamberlain
  Where is Chris Chamberlain?
 GL6 0PN
 United Kingdom
 Chris Chamberlain
 Tags
Subject: RE: Select Multiple records by clicking Shif
Thread ID: 265087 Message ID: 268872 # Views: 32 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Thursday, July 15, 2010 6:53:43 AM         
   


> > Dear Experts.
> >
> > Please consider the following scenario.
> >
> > Grid rows should able to be selected by using shift+hold and clicking the end of the range that needs to be selected
> > Please help me on above requirement
> > Please refer to the attached image for more details
> >
> > Thanks in advance
> >
>
> Take a look at the code here for ideas
>
> https://www.foxite.com/faq/default.aspx?id=3
>
> Chris
>
> www.motrac.co.uk
> www.pdfcommander.com

Dear Chris,
Thanks for the previous code.
Please advice me on following case.
The RecordSource is indexed and cannot be removed. Get it from a SELECT – SQL is impossible as i have to change the code in many areas in exe.
I need only shift + click followed by shift + click will selecting a block of records to be done.
i.e I have implemented only the following code in mSelectedRecords()
IF GetKeyState(VK_lSHIFT)< 0 OR GetKeyState(VK_lSHIFT) > 1
DO CASE
CASE .nLastRow > .nActiveRow
.nRecs2Change = .nLastRow - .nActiveRow
REPLACE (lcSelected) WITH .T. IN (lcRecordSource)
FOR i = 1 TO .nRecs2Change
REPLACE (lcSelected) WITH .T. IN (lcRecordSource)
SKIP IN (lcRecordSource)
ENDFOR
CASE .nLastRow < .nActiveRow
.nRecs2Change = .nActiveRow - .nLastRow
REPLACE (lcSelected) WITH .T. IN (lcRecordSource)
GO .nLastRow IN (lcRecordSource)
FOR i = 1 TO .nRecs2Change
REPLACE (lcSelected) WITH .T. IN (lcRecordSource)
SKIP IN (lcRecordSource)
ENDFOR
ENDCASE
ENDIF

As I have indexed the recordsource this is not working as expected.
Some times it is selecting other records which are not to be selected.

Can you help me on the above task ?

Thanks in Advance

ENTIRE THREAD

Select Multiple records by clicking Shif Posted by Muhammed Shafraz @ 6/18/2010 5:51:54 AM
RE: Select Multiple records by clicking Shif Posted by Samir H. @ 6/18/2010 6:45:15 AM
RE: Select Multiple records by clicking Shif Posted by Jun Tangunan @ 6/18/2010 6:50:28 AM
RE: Select Multiple records by clicking Shif Posted by Muhammed Shafraz @ 6/18/2010 8:07:28 AM
RE: Select Multiple records by clicking Shif Posted by Jun Tangunan @ 6/18/2010 8:37:42 AM
RE: Select Multiple records by clicking Shif Posted by tushar @ 6/18/2010 8:58:54 AM
RE: Select Multiple records by clicking Shif Posted by Yousfi Benameur @ 6/18/2010 11:39:02 AM
RE: Select Multiple records by clicking Shif Posted by Chris Chamberlain @ 6/18/2010 2:50:33 PM
RE: Select Multiple records by clicking Shif Posted by Muhammed Shafraz @ 7/15/2010 6:53:43 AM
RE: Select Multiple records by clicking Shif Posted by Chris Chamberlain @ 7/15/2010 8:56:24 AM
RE: Select Multiple records by clicking Shif Posted by Muhammed Shafraz @ 7/15/2010 9:07:27 AM
RE: Select Multiple records by clicking Shif Posted by Cetin Basoz @ 7/15/2010 12:46:56 PM
RE: Select Multiple records by clicking Shif Posted by Tony Vignone @ 7/15/2010 6:30:00 PM