Page 1 of 1

DataGrid Form Row Change

Posted: Fri Mar 25, 2016 11:50 pm
by newpie
Hello, I have a datagrid Form and trying to update row in a repeat loop, I confirm the array is being changed, I am just having trouble making it update on screen when repeat loop is done:

Code: Select all

on mouseUp
   put the dgData of group "formGrid" into theDataA
   put the dgIndexes of group "formGrid" into theIndexes
   
   repeat for each item theIndex in theIndexes
      put theDataA[theIndex]["Status"] into tStatus--this value is already in record     
      
      if tStatus= "true" then
         put "pic.png" into theDataA[theIndex]["pic"]
      else
         send "DeleteIndex theIndex" to grp "formGrid"
      end if
   end repeat
   -- I would like to repopulate datagrid with only the records that are left
   send "RefreshList" to grp "formGrid"  --update changes but I suspect this does not put records left at top
end mouseUp
Thanks for any help

Edit: fixed typo

Re: DataGrid Form Row Change

Posted: Sat Mar 26, 2016 3:08 am
by sritcp
Hi newbie:

Code: Select all

send "RefreshList" to grp "addGrid"
Was "addGrid" a typo? Should it not be "formGrid"?

Regards,
Sri

Re: DataGrid Form Row Change

Posted: Sat Mar 26, 2016 4:19 pm
by newpie
This seems to have done the trick for the update of the pic if it helps anyone. Thanks

Code: Select all

    on mouseUp
       put the dgData of group "formGrid" into theDataA
       put the dgIndexes of group "formGrid" into theIndexes
       
       repeat for each item theIndex in theIndexes
          put theDataA[theIndex]["Status"] into tStatus--this value is already in record     
         
          if tStatus= "true" then
             put "pic.png" into theDataA[theIndex]["pic"]
          else
             send "DeleteIndex theIndex" to grp "formGrid"
          end if
       end repeat
       set the dgData of group "formGrid" to theDataA
       dispatch "RefreshList" to grp "formGrid"
    end mouseUp