I'm binding a datatable to a gridview control, and when I format each column I need to format the data based on whether that column has a particular custom attribute. In this case, a column can represent:
The problem is that the column data types are all strings in the untyped data table being bound to the grid, currently. And the binding uses autoGenerateColumns. So:
I hope I asked this right. Phew!
The best way to do this is to turn off the autogeneration of columns, and then replace the BoundFields for the columns you care about with TemplateFields. There is a tutorial on ASP.NET that can fill in more of the details.