I fill the form with data from the selected gridview row in asp.net
TXTName.Text = Grid.SelectedRow.Cells.Item(1).Text.ToString
Refunds: Bol & # 237; vares Fuertes
TXTName.Text = Grid.DataKeys(grdMaestro.SelectedRow.RowIndex).Values(1).ToString
Returns: "Bolívares Fuertes"
the first time letters with accents are displayed as & #XXX, and the second is excellent. The problem with the second method is that I have to include all the rows in the datakeynames attribute, and this can cause some problems if I end up using automatic updating and removing gridview controller functions.
NOTE. I inserted a space between "Bol &" And "# 237; vares Fuertes" because stackoverflow fixed it in the preview
source share