How to get Id from gridview

Hello all pls have me!!!

I have 3tables shipment, goods, goodsShipment

when I create shipment I need to select goods(shipment have many goods).

And then I save Id_goods and Id_shipment in table goodsShipment

I have gridview that have checkbox(table goods). When select checkbox I want to get Id from gridview

to save in anther table(table goodsShipment).My problem when I’m submit How to get Id from gridview

to save in anther table??