(Transfer) HTML encoding of strings on the DataGrid table (very important)

xiaoxiao2021-03-06  42

because:

Show the string after the HTML encoded on the Cell of DataGrid, how to do it? If there is still malicious code! I want the webpage, I will have a mess!

case:

For example: I have a DataGrid, used to display the data of custom tables in the database, with the username information, if someone is entering this information "