请问在GridView中,bollean值如何根条件改变??
我想在字段:性别,布尔值。如果是TRUE,显不男,否则显示女。请改下下面的代码,谢谢。
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
DataKeyNames="xi_id" DataSourceID="AccessDataSource1" Width="920px" CellPadding="4" ForeColor="#333333" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="性别" SortExpression="性别">
用模板
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("性别") %>'></asp:Label>
</ItemTemplate>
不用模板:
<asp:BoundField DataField="性别" HeaderText="性别" SortExpression="性别">
<ItemStyle Width="50px" />
</asp:BoundField>