DataGrid problem
Posted: Fri Mar 22, 2024 11:36 am
Hi,
I'm troubleshooting a problem, updating the stock column in DG3, and to make it simple I've 'condensed' it into the following code, activated when the user selects a line (row).
I'm expecting the 'stock' column to be updated but it doesn't happen. Any ideas why ?
I'm troubleshooting a problem, updating the stock column in DG3, and to make it simple I've 'condensed' it into the following code, activated when the user selects a line (row).
Code: Select all
on selectionChanged pHilitedIndexes, pPreviouslyHilitedIndexes
send "mouseup" to btn "extract" of cd "manage products"#gets data into fields
send "mouseup" to btn "setdg"#shows columns appropriate to one of the fields
put fld "stockused" of cd "manage products" into stockused
answer fld "stockused"#works OK
put the dgHilitedIndex of grp "datagrid 3" of cd "manage products" into tIndex
put the dgDataOfIndex[tIndex] of grp "datagrid 3" of cd "manage products" into tArray
put 3 into tArray["stock"]
put tArray["stock"] into fld "stockused"
answer fld "stockused"#shows 3, all OK
set the dgDataOfIndex[tIndex] of grp "datagrid 3" of cd "manage products" to tArray
end selectionChanged