There's a trick to this. The Hyperlinkcolumn won't work, because you can't format the link. You want to use a boundfield and format the text. Like so
<asp:GridView ID="GridView1" runat="server" EnableModelValidation="True">
<Columns>
<asp:BoundField DataField="Code" HtmlEncode="False" DataFormatString="<a target='_blank' href='Test.aspx?code={0}'>Link Text Goes here</a>" />
</Columns>
</asp:GridView>
Alternately, you can use a templatefield if you need to designate edit and insert templates.