Currently in my gridview I have this:
Code:
<asp:BoundField DataField="dsc" HeaderText="Component" />
However, what the logic needs to be is if a field in my database table called "cog" is null I want to put the word "INDEX" in the gridview Component column and if "cog" is not null that is when I want to put the value of "dsc" from my database table in the gridview (what it is doing now).

I'd rather not do this in the code-behind (but I could if that is the recommended way) so can anyone help me write the logic in the gridview? I know I need a TemplateField but I'm not sure how to write a conditional statement in a TemplateField. I assume call a piece of javascript somehow...

Thanks.