Need help to add value to datagrid

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
blairetabay
Posts: 34
Joined: Mon Feb 24, 2014 10:12 am

Need help to add value to datagrid

Post by blairetabay » Sun Mar 02, 2014 3:09 pm

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

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Need help to add value to datagrid

Post by Klaus » Sun Mar 02, 2014 4:06 pm

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

blairetabay
Posts: 34
Joined: Mon Feb 24, 2014 10:12 am

Re: Need help to add value to datagrid

Post by blairetabay » Sun Mar 02, 2014 4:24 pm

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



Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Need help to add value to datagrid

Post by Klaus » Sun Mar 02, 2014 4:33 pm

It works now? :shock:

Great :D

Post Reply