You use the RowDataBound event of your Gridview.
protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
{
...
DataRowView rowView = (DataRowView)e.Row.DataItem;
if(!string.IsNullOrWhitespace(rowView["CID"].ToString())
hl.NavigateUrl = "EditCompany.aspx?CID=" + rowView["CID"].ToString();
...
}