I have the following code that generates my GridView:
protected void Page_Load(object sender, EventArgs e)
{
try
{
AlteracoesContrato alteracoes = new AlteracoesContrato(movimentacaoId);
grdListaAlteracoes.DataSource = alteracoes.ListaResumidaAlteracoes;
if (alteracoes.ListaResumidaAlteracoes.Count > 0)
{
lblAviso.Visible = false;
BoundField linkColumnBoundField = new BoundField();
linkColumnBoundField.HeaderText = "Visualizar";
grdListaAlteracoes.Columns.Add(linkColumnBoundField);
grdListaAlteracoes.DataBind();
}
else
lblAviso.Text = "Nenhuma alteração foi realizada nesse contrato.";
}
catch (Exception ex)
{
lblAviso.Text = "Erro ao exibir alterações do contrato.";
GravaLogErro(ex);
ShowAlert(ERRO_RECUPERAR);
}
}
In the% wrapper I add a column to the grid, but I do not know how popular each field with the link I want.
I thought of putting the HTML right into the initial list that mounted the Grid, but I did a test and it does not encode the HTML and the text is shown with the tags instead of the link.
How can I add this column to the links?