Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: kaustubh jambotkar
  Where is kaustubh jambotkar?
 Bicholim
 India
 kaustubh jambotkar
 Tags
Subject: RE: Check box in Readwrite cursor grid
Thread ID: 365787 Message ID: 365791 # Views: 47 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Monday, December 31, 2012 1:41:30 PM         
   


> Hi
> i have got one form, where in i want to give the user the option of multiselect, with the following code which i got from seaching,i get the grid with a check box, however i cant change the values of check box.
>
> i need help on this.
>
> use in select( "newbin" )
> select ;
> .f. as IsChosen, ;
> E.* ;
> from ;
> binlot E;
> into ;
> cursor newbin READWRITE
> Thisform.grid1.RecordSource =""
> Thisform.grid1.RecordSource = "newbin"
> WITH thisform.grid1.column1
> .AddObject("Check1","checkbox")
> .sparse=.f.
> .CurrentControl = "Check1"
> ENDWITH
>
> thisform.grid1.refresh
> regards

You can download and use famous FoxyClasses - MultiSelectGrid class instead (it has capabilities beyond just providing a checkbox like searching):

http://www.medikosoft.com/cetin/FoxyClasses.zip

-Extract to a folder say C:\FoxyClasses
-In your form click books icon in form controls toolbar, select FoxyClasses\Classes\Grids.vcx
-Choose MultiSelectGrid from toolbar and place in your form.
-Set its cSQL to:
* from binlot

-Set chkboxes to .t. and run. It is basic usage.

You can count and find out the selected records (say a button click):


with thisform.multiSelectGrid1
  lnCount = .GetSelectedCount()
  messagebox( m.lnCount )
*  select * from (.CursorName) where lSelected
  select (.CursorName)
  scan for lSelected
   *...
  endscan
endwith




Cetin Basoz

.Net has got better.Think about moving - check my blog:
My Blog
Blog (mirror) - sounds to be down


Support Wikipedia

ENTIRE THREAD

Check box in Readwrite cursor grid Posted by kaustubh jambotkar @ 12/31/2012 1:28:47 PM
RE: Check box in Readwrite cursor grid Posted by Cetin Basoz @ 12/31/2012 1:41:30 PM
RE: Check box in Readwrite cursor grid Posted by Mihir Shah @ 12/31/2012 2:06:20 PM