Below is the approach you can follow to solve your problem. This article of working with DataTable will help you in this regard http://www.dotnetfunda.com/articles/show/131/datatable-adding-modifying-deleting-filtering-sorting-rows-readingwrit
- Before setting the DataSource of the GridView, create a new DataTable like var myNewTable = new DataTable();
- Add columns exactly the same as you have into your original DataTable EXCEPT the bit column where you have checked and unchecked column. Make this column as varchar where you are going to store Yes/No. Let's say this column name is "IsMale"
- Loop through each rows of the original table and add new row into the myNewTable created into step 1. In each iteration of the loop while saving the value of last column "IsMale" created in step 2, check whether the bit column value of original table is true, if it is then store "Yes" into "IsMale" column otherwise store "No".
- Now you have all the rows of the original DataTable to new DataTable that we have created in step 1 with Yes and No values instead of bit value (checked/unchecked).
- Set the GridView data source to the new datatable (myNewTable) where your modified data is there
You should be getting Yes/No now in the gridview output.
Hope this will solve your problem, do not forget to read the above article that will help you log following above steps.
Rasagna, if this helps please login to Mark As Answer. | Alert Moderator