<asp:DataGrid id='DataGrid1' runat='server' AutoGenerateColumns='False'>
<Columns>
<asp:TemplateColumn HeaderText='Status'>
<ItemTemplate>
<%#ShowStatus(bool.Parse(DataBinder.Eval(Container.DataItem,'Discontinued').ToString()))%>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
VB.NET
protected Function ShowStatus(ByVal someval as boolean)
If someval = true Then
ShowStatus = 'Yes'
Else
ShowStatus = 'No'
End If
End Function
C#
protected string ShowStatus(bool someval)
{
if (someval == true)
{
return 'Yes';
}
else
{
return 'No';
}
}
Share with