Page 1 of 1

Need help to add value to datagrid

Posted: Sun Mar 02, 2014 3:09 pm
by blairetabay
I have a problem regarding with the datagrid. All i want is to add a value inside my datagrid
using a textbox. i dont have any idea how to do it

here is my code

Code: Select all

  put field  txt_caseNum into  caseNum
   put field txt_drName  into drName
   put field txt_searchNum  into txt_Num

   put caseNum & tab & drName & tab& txt_Num into temp
   put "case" & cr & "laboratory" & cr & "dr" into theDataColumns
   #set the dgText of group "dgGrid" to temp
   set the dgtext of group "dgGrid" to temp
   
   put the dgNumberOfLines of me + 1 into theLineNo 
   
   
   dispatch "Addline" to the group "dgGrid" with temp, theDataColumns, theLineNo
   
   Put the result into theLineNo

any help is accepted

Re: Need help to add value to datagrid

Posted: Sun Mar 02, 2014 4:06 pm
by Klaus
Hi Blaire,

1. please stop using CAPITALS, this means SHOUTING in the internet!
I change the subject accordingly. 8)

2. The script looks correct, so the question is WHERE did you put that script?
Resp. what ME (put the dgNumberOfLines of me...) is the script referring to?
How is the script triggered? "mouseup" etc...?

HInt: Use QUOTES around object names!
...
put field "txt_caseNum" into caseNum
put field "txt_drName" into drName
put field "txt_searchNum" into txt_Num
...

Best

Klaus

Re: Need help to add value to datagrid

Posted: Sun Mar 02, 2014 4:24 pm
by blairetabay
hi Klaus,


sorry for my manner of putting a capital Letter.

i beg for your pardon

Thank you for adding some information about this.

here is my code and it work now.

i just to like to share what i learn.

Code: Select all

on mouseUp

   put field  "txt_caseNum" into  caseNum
   put field "txt_drName"  into drName
   put field "txt_searchNum"  into txt_searchNum
   put field "txt_lab" into labType
         
   put caseNum & tab & drName & tab& txt_searchNum into temp
   put "case" & cr & "laboratory" & cr & "dr" into theDataColumns
   
   put the dgNumberOfLines of me + 1 into theLineNo 
     
   dispatch "Addline" to the group "dgGrid" with temp, theDataColumns, theLineNo

   
end mouseUp



Re: Need help to add value to datagrid

Posted: Sun Mar 02, 2014 4:33 pm
by Klaus
It works now? :shock:

Great :D