Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid created by code - operate on all records

Status
Not open for further replies.

coldan

Programmer
Oct 19, 2008
98
AU
On my form I have A GRID (10 fields) in which are two fields I manipulate programmatically.

A checkbox ( to signify whether that record should be deleted)

A logical field [do_dele] to record the deletion for later processing

If the checkbox is clicked for a 'Delete' selection I use

<code>
Thisform.grid1.SetAll("DynamicFontStrikeThru","DODELE = .t.")
</code>


To strikethrough that record for a visual indication.

This is all working for a single records.

I wish to allow a deletion of ALL records if the messagebox entry is [Yes] when prompted after clicking the checkbox.

I can change all the checkboxes and the do_dele fields but how do I strikethrough ALL records programmatically?

regards

Coldan
 
Instead of using this code in the click of the checkbox, put it in the grid's Init method.
 
Coldan,

As Markros correctly says, place your code in the grid's Init (it only needs to be executed once), not at the time of the click.

However, you also need some code in the checkbox's Click. That code needs to set DODELTE to .T., and also refresh the grid. It's the Refresh that causes the DynamicXXX properties to be evaluated and applied.

You refer to a messagebox. I can't see where that comes into the picture.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thanks for the comments.

I had the solution just after I posted <sigh>

Coldan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top