You need to use HtmlDecode
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[3] { new DataColumn("ContactName", typeof(string)),
new DataColumn("City", typeof(string)),
new DataColumn("Country",typeof(string)) });
dt.Rows.Add("Sergio Gutiérrez", "México D.F.", "Belgium");
dt.Rows.Add("Lúcia Carvalho", "Genève", "Austria");
dt.Rows.Add("Münster", "Frédérique Citeaux ", "Ireland");
GridView1.DataSource = dt;
GridView1.DataBind();
DataTable dt2 = new DataTable();
for (int i = 0; i < GridView1.Columns.Count; i++)
{
dt2.Columns.Add("column" + i.ToString());
}
foreach (GridViewRow row in GridView1.Rows)
{
DataRow dr = dt2.NewRow();
for (int j = 0; j < GridView1.Columns.Count; j++)
{
dr["column" + j.ToString()] = Server.HtmlDecode(row.Cells[j].Text);
}
dt2.Rows.Add(dr);
}
}
}