1 (edited by v_pozidis 2023-12-05 20:01:23)

Topic: transfer from tablegrid

From the table I would like all the names that are selected from the checkbox to be transferred to the memobox when pressing the button

Post's attachments

Attachment icon Choise.zip 325.29 kb, 29 downloads since 2023-12-05 

Re: transfer from tablegrid

Hi,
Try it like this (see attached). 
I'm guessing that there are probably two ways you might want to see the selected rows in the memo fields (one per line or comma delimited) so both options are in the script.
Regards,
Derek.

Post's attachments

Attachment icon select by checkbox.zip 437.73 kb, 47 downloads since 2023-12-06 

Re: transfer from tablegrid

Thank you Derek. To understand it can you please explain what the followin line means  if form1.tablegrid1.cell[0,vi].asboolean = true  (asboolean) and also the form1.tablegrid1.cell[1,vi].asstring (asstring). Thank you in advance. Yo know if you do not ask then you will never learn.

Re: transfer from tablegrid

Hi,

if form1.tablegrid1.cell[0,vi].asboolean = true  (asboolean) and also the form1.tablegrid1.cell[1,vi].asstring (asstring).

Basically, when you query the contents of an individual cell in a tablegrid, you need to specify 3 things
1.  which column the cell is located in (in your example, this is column 0)
2.  which row the cell is located in (in your example, this is the variable 'vi').
3.  what data type the cell contents contains (boolean, integer, datetime etc etc).  All cells are presented as strings in the tablegrid so, because a checkbox is a 'boolean' field, you need to specify '.asboolean' in your script if you want to perform some action on it.
Have a look at the amended example;  tick a couple of the checkboxes in the tablegrid and then click the 'all the checked' button and you can see the different data types being displayed in the 'message box' as you move through the tablegrid.
There are (as always with MVD) other ways of copying cells from the tablegrid to an edit or memo field that don't involve using the 'checkbox' - it all depends on what you are doing and how you want your application to flow.
I hope this makes things clearer.
Derek.

Post's attachments

Attachment icon select by checkbox2.zip 438.68 kb, 49 downloads since 2023-12-06