A
ad
I have a field name SexID, it store 1 for male, 2 for female.
I want to present male/ female in the DataGrid.
I convert the field to a template column and then use a tmeplate
expression
like this:
<%# ( (int) DataBinder.Eval(Container,"DataItem.SexID")) == 1 ? "male" :
"female" %>
But it result into a System.InvalidCastException.
How can I do?
(This method is from Rick Strahl)
I want to present male/ female in the DataGrid.
I convert the field to a template column and then use a tmeplate
expression
like this:
<%# ( (int) DataBinder.Eval(Container,"DataItem.SexID")) == 1 ? "male" :
"female" %>
But it result into a System.InvalidCastException.
How can I do?
(This method is from Rick Strahl)