Hiding column is not good solution to your problem, You can easily solve your issue with templatefield and DataKey. assign your primary key column name into DataKey. Checkout the example below,
Later you can get the primary key of the selected row by using,
DataKey currentKey = myGridView.SelectedDataKey;
Hope this will help.