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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox on a grid.... VFP 7.0

Status
Not open for further replies.

RFanslow

Programmer
Jul 16, 2014
24
0
0
US
I seem to getting older and forgetting some of my old tricks...

i have a simple grid with a check box, upon load of the data each box is marked .T. or checked…
users want to uncheck some or all of the check boxes... in single click…
any suggestions…

Fanz


 
i would add a checkbox above the grid and in this click event of the checkbox

Something off the type of my head...

In the clickevent of the checkbox (above the grid) or interactive change of the checkbox.
Local lnSelect
lnSelect = Select()
select myTable
lnRec = Recno('myTable')
replace MyLogicalField with this.Value
thisform.YourGridName.Refresh()
goto lnRec
thisform.YourGridName.Refresh()

Select(lnSelect)





Ez Logic
Michigan
 
The thing to remember is that the grid reflects the data in the underlying table. So, instead of programmatically clearing the checkbox, you need to programmatically set to .F. the logical field to which the checkbox is bound. Once you've done that, you SetFocus to the grid, and the checkboxes will be automatically updated.

You said you want to let the user "uncheck some or all of the check boxes". Th mechanism I described above isn't selective: it will clear all of them. You would have to supply some additional logic if you wanted to let the user uncheck some but not all of them.

Also, I suggest you provide another checkbox to set them all.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
thanks, I resoved this by using the "RightClick event of the checkbox object depending on its value (.T./.F.) .
i either check or uncheck then utilized the "Rest" feature to do the remaining

Thanks

Fanz
 
Right click? Really?

When I right click an object in pretty much any Windows (or Mac) app I expect a popup menu. It would never occur to me to toggle a set of checkboxes that way.

It works, sure, but it's really unusual and the main benefit behind the Windows (and Mac) GUI is that all things behave pretty much the way you'd expect them.
 
Dan
I clearly could have used a "Menu style pop/form" to let the user do the same thing, but when dealing with hundreds of possible rows, i really dont see any good functionalty to check/uncheck the remaining hundreds of rows without hundreds of clicks.

i am always open for new shortcuts or designs to accomplish the same things...

Fanz
 
Fanz,

It wasn't the functionality that Dan was commenting on, but rather the decision to use a right-click to trigger it.

Obviously, we've all got our own styles and habits for user interfaces. But personally I would give the user four small buttons (or hyperlinks): Check All; Check Rest; Clear All; Clear Rest.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
i really dont see any good functionalty to check/uncheck the remaining hundreds of rows without hundreds of clicks

You've got two good suggestions right here in this thread. Personally, I'd probably go with Mike's suggestion.

But, really, the conundrum you point out is exactly why it's generally a bad idea to display that many rows to the user. Lists (and grids) lose their utility quickly as you add more rows to them.

For "select all", you could also borrow from some of the fairly easy to use email interfaces like gmail. They have a checkbox above the rows of messages that means "select all". It's a REALLY common interface technique that your users already know. That's always a good thing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top