function gridUpdate(row, col)
local tempWepName = guiGridListGetItemText(wepGrid, row, wepGrid_ID)
for i, v in ipairs(wepTable) do
if v["ID"] == tonumber ( tempWepName ) then
local wepID = v["ID"]
local wepName = v["Name"]
local wepPrice = v["Price"]
local wepDual = v["Dual"]
local wepClip = v["Clip"]
local wepType = v["Type"]
guiSetText(nameVar, tostring(wepName))
guiSetText(dualVar, tostring(wepDual))
guiSetText(clipVar, tostring(wepClip))
guiSetText(typeVar, tostring(wepType))
break
end
end
guiGridListClear(wepGrid)
for i=1,#wepTable do
local row = guiGridListAddRow(wepGrid)
guiGridListSetItemText(wepGrid, row, wepGrid_name, wepTable[i]["Name"], false, false)
guiGridListSetItemText(wepGrid, row, wepGrid_price, wepTable[i]["Price"], false, false)
guiGridListSetItemText(wepGrid, row, wepGrid_ID, wepTable[i]["ID"], false, false)
end
guiGridListSetSelectedItem(wepGrid, row, col)
end
P.D: You could store the data of each weapon in the row using guiGridListSetItemData.