Simplicty and flexibility!


Radioboxes - how to filter on them and clear them

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

Radioboxes - how to filter on them and clear them

Download Sample

You can of course add a choice (default maybe) that is None or something like that, as you as you rightly have pointed out can't deselect a RadioBox from the RadioBox itself.

However there is plenty of ways to do this.

The simplest way is simply to hit F6 (field clear) when the radiobox has focus. This is a little "Old style" as modern users want to click themselves out of everything rather than using function keys etc.

So in the attached example we also add a dblclicked event on "your" Radiobox so if you dblclick on it it will clear (just try).

The second question is how to filter your data from a button.

That too is rather straight forward.

Here we use the two functions SelectionFilter() and FilterClear().

Selectionfilter is a very powerful function that is quite underutilized, maybe because it is slightly illogical.

SelectionFilter(String,String) sets the filter as a string. It has as you can see two arguments so it would be logical to think that it would be the column in the first

and the value in the second...but no. It seems that it has two argument to circumvent the 255 boundry so you can set a 512 long filter....

So the filter is the combination of the two

Here: SelectionFilter("MyRadioBox=","Member") or SelectionFilter("MyRadioBox=Member","") or SelectionFilter("","SelectionFilter("","MyRadioBox=Member")

are all the same...yes, confusing.

An here we dodge a bullet, as the value is a choice and hence is to be represented in a derviation (filter) without "" but what if the field was text?

SelectionFilter("MyRadioBox="Member"","") is obviously not allowed/working.

Pre DE8 this would have been a serious nut to crack but luckily in DE8 we have escape characters so the solutio is simply.

("MyRadioBox=.'Member.'","")

Characters include is:

" = /'

CR = /CR (New line)

TAB=/TB (Tab)

We hope this helps.


Written by DataEase 01/02/21 at 11:08:34 Dataease [{8}]FIVE
DG3_BlogList