How to get selected value of multiple-selection listbox (InfoPath) - listbox

How to get the selected value from the multiple-selection listbox ( InfoPath form)
I have a multiple selection listbox like this:
Display text , Value
110-SS , 110
120-ST , 120
130-SW , 130
how can I make the condition when listbox selected value was contain with '130' ?

If you want a condition that is true when the MSLB has 130 selected, you would simply use:
ListBoxField equals 130
If you want a condition that is true when the MSLB does not have 130 selected, you would use:
All instances of ListBoxField are not equal to 130

Related

Show different value based on Checkbox tick

I have 2 checkboxes and 1 cell
When checkbox 1 is ticked I want to show "Checkbox 1 selected" in the cell
When checkbox 2 is ticked I want to show "Checkbox 2 selected" in the cell
=OR((A1,"Checkbox 1 selected",""),(A2,"Checkbox 2 selected",""))
What am I doing wrong?
Here you go. You were missing the IFs.
You should JOIN the functions instead of using OR which returns TRUE or FALSE, not the text you are trying to get from your IF functions.
=JOIN(", ",IF(A1,"Checkbox 1 selected",""),IF(A2,"Checkbox 2 selected",""))
If you will never have both checked at once, this formula will be shorter.
=IF(A1,"Checkbox 1 selected",IF(A2,"Checkbox 2 selected",""))

Count values until the first empty cell

What I looking for is how to count as many values in column, but I want it to stop counting as soon as it hits the first empty cell. I am trying to do it without using app script.
Example:
1
2
312
EMPTY
3123
Should return 3, if I simply use COUNTA(), it will return 4.
Any ideas?
If your "empty" cells are indeed BLANK then you can use the following:
=ArrayFormula(match(TRUE,ISBLANK(A1:A13),0)-1)
(as long as there is always an empty row between the sets of "Years"
the ISBLANK(A1:A13) returns an array result {FALSE,FALSE,FALSE,TRUE,FALSE,...}
the match() returns the POSITION or ROW of the first TRUE in that list : 4
we then take away 1, for the empty row
we have to run the whole thing as an array formula because we need ISBLANK() to work on each cell in turn.
if they contain text "EMPTY" then use:
=ArrayFormula(match(TRUE,if(A1:A13="EMPTY",TRUE,FALSE),0)-1)

cxgrid - set all checkboxes checked

I am using the cxGrid. I have a field (column) in my grid that is of boolean type (true/false) represented in the grid as a checkbox. How can I make all the checkboxes in the column checked (or unchecked) on button click ?
it looks like this :
Now I would like, on button click, to turn those 3 checkboxes checked BEFORE I save everything..
DATA on the left(USERS) comes from a table, the data on the right is from a query. The SAVE of everything goes to a separate LOG table.
When I hit 'Check all' button,the result :
I could run the update query : update MYFIELD set SELECTED = '2';
but I am more interested in manipulating the grid itself.Something simple...
You will have to add a button or pop up menu somewhere on your form to accept the check all 'command', or maybe even place a checkbox in your column header. Then go through your underlying dataset and set all field values. Don't forget a DisableControls/EnableControls.
added an extra field to my table (boolean type) and changed its property in the cxGrid to that of a checkbox.Then on button click:
with uniquery1 do begin
Active:=False;
sql.Clear;
SQL.Add('update users set selected = 0'); //or '1'
execSql;
end;
Uniquery1.Refresh;
this I found was the easiest way ....

delphi comboBox

how does one get the picked value of a combo box from delphi 7
lets say it has items, how does one know which row (item) was picked?
You find the selected item with:
combobox.ItemIndex; // -1 if none
You can get the value using
combobox.Items[combobox.ItemIndex]
combobox.text will hold the value which was selected
When you want to use combobox.text, i recommend to set style to csDropDownList and ItemIndex to 0 in object inspector to have combobox initialized.

cxGrid: how to cast a cell to a combobox-object

i have a problem with my cxgrid. in my cxgrid there a different rows and columns which have comboboxes as properties. but how can i cast a special cell value to a combobox-object? for example: i want to set the itemindex of the combobox in row 1 and column 2 to 0.
thanks!
The ItemIndex you cannot set, because it is suplied by the DataSource (or data provider).
But you can set other properties implementing the event OnGetProperties of your grid column:
TcxComboBoxProperties(Sender.Properties).DropDownRows := 9

Resources