Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mark column whith checkbox in a grid
Message
From
07/06/2001 02:21:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
06/06/2001 17:11:19
Ing. T.R.M. Pluym
Pluym Elektronics Bv
Hulst, Netherlands
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00516061
Message ID:
00516177
Views:
12
>I'm working to make a grid for an application, where I can select some records by clicking a checkbox in a grid. I figured out how to put a checkbox in a grid.
>Now i want an array containing the recordnumbers i have ticked in the grid. When I de-tick a checkbox in the grid i whant to remove the record number from the array. But when I bind:
>
>=iIf( ASCAN( aRecs, RecNo() ) = 0,.F.,.T.)
>
>to the controlsource of the checkbox column the grid blanks when I want to run it. What's wrong and how can i solve it ?

Arrays are dangerous for grids because they have a limit of 65000 elements.
Next you don't need an array or something else where you already have a field for it. If you don't have a field than it'd be a calculated field which is readonly and you wouldn't be able to mark/unmark.

Grid goes blank when it cannot resolve a column's controlsource expression. Here most probably it went blank for you used arecs as a local array. As assigning controlsource routine ended aRecs went out of scope. If aRecs were a say form property or public grid wouldn't go blank.
However remember this way you're predetermining selected records and marking them, user can't change it.

Another note on your expression :
If your expression would return a logical then it's unnecessary to make an iif() construction. Directly write the logical expression. ie :
(ascan(thisform.aRecs,Recno())#0)

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform