I am working in asp.net .net framework 4, i have a data grid and it has a column having values 1,2,3 etc, i want to rename them during binding with if condition, for example if value is 1 display YES, if value is 2, display NO, like that…
I know that grid has an event data bound, but i dont know how to change the value of cell on the bases of if condition in this event, please help.
Thanks
Atif
Use condition inline in
.aspx:Use method at codebehind to format value:
.aspx
.cs
Using
RowDataBoundevent in codebehind (not elegant, but should work):