R
rote
I have a DropDownList in a DetailView like so
<asp:TemplateField HeaderText="PCode">
<ItemTemplate>
</ItemTemplate>
<EditItemTemplate>
<aspropDownList ID="ddlCode" runat="server" BackColor="Pink"
DataSourceID="SqlDataSource2"
DataTextField="PCode" DataValueField="PCode" SelectedValue='<%#
Bind("PCode") %>'>
</aspropDownList>
</EditItemTemplate>
</asp:TemplateField>
The pcode is either 0,1,2
I need to change the DataTextField to a text string for example
if pcode is 0 then "boy"
if pcode is 1 then "girl"
Any ideas ?
Sure a function that returns a Datasource should be able to do it
But is there anyway i can do it in my aspx page?
<asp:TemplateField HeaderText="PCode">
<ItemTemplate>
</ItemTemplate>
<EditItemTemplate>
<aspropDownList ID="ddlCode" runat="server" BackColor="Pink"
DataSourceID="SqlDataSource2"
DataTextField="PCode" DataValueField="PCode" SelectedValue='<%#
Bind("PCode") %>'>
</aspropDownList>
</EditItemTemplate>
</asp:TemplateField>
The pcode is either 0,1,2
I need to change the DataTextField to a text string for example
if pcode is 0 then "boy"
if pcode is 1 then "girl"
Any ideas ?
Sure a function that returns a Datasource should be able to do it
But is there anyway i can do it in my aspx page?