A complete code is not possible as the database os with you.
The fetching code you will need to write yourself. I gave you an example that if A, N, D comes from database, how in GridView you can change text.
Thus you simply need to get the datatable from database with A, N, D and it will work as you want