Delete Line In Data Grid
Posted: Fri May 17, 2013 5:39 am
I know this is most likely a simple solution, but I cannot seem to figure this out. I have a DG Form that I have customized with a few buttons and fields. One of the buttons is an "Edit" button that takes the text from the various fields that reside in the row and places them in another card for editing. This all works fine, but I cannot seem to delete the hilited line of the data grid within the script of the button that resides inside the row template group. If I place a button outside of the DG row template group, deleting the line works fine. I think it is just how I am referring to the object since it is inside this group. Just so you know, I have been reading other posts and lessons to figure this out, so this is my last ditch effort before bed! My script for the button is below...thanks
Code: Select all
on mouseUp
--Populate the description fld with the DG data
put fld "orderItem" before fld "description" cd "description"
put fld "OrderInfo" after fld "description" cd "description"
put fld "total" into fld "total" cd "description"
--Change the state of the button depending on what size was selected
if "Small" is among the words of fld "description" cd "description" then set the backgroundColor of btn "Small" cd "description" to "green"
if "Medium" is among the words of fld "orderItem" then set the backgroundColor of btn "Medium" to "green"
if "Large" is among the words of fld "orderItem" then set the backgroundColor of btn "Large" to "green"
--Delete the hilited line of the DG
--This button resides inside the DG Row Template and this is where I am having trouble....
put the dgHilitedLines of group "DataGrid" of the dgControl of me into theLine
dispatch "deletelines" to grp "DataGrid" of the dgControl of me with theLine
visual effect "push right very fast"
go cd "description"
end mouseUp