技术开发 频道

实现gridview中某字段数据重复出现显示颜色

 前台代码:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 <html xmlns="http://www.w3.org/1999/xhtml" >

 <head id="Head1" runat="server">

 <title>GridView突出显示某一单元格 清清月儿http://blog.csdn.net/21aspnet </title>

 </head>

 <body >

 <form id="form1" runat="server">

 <div  >

 <asp:GridView ID="GridView1" runat="server"    AutoGenerateColumns="False" CellPadding="3"  OnRowEditing="GridView1_RowEditing"

 OnRowUpdating="GridView1_RowUpdating" OnRowCancelingEdit="GridView1_RowCancelingEdit" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" Font-Size="12px"  >

 <FooterStyle BackColor="White" ForeColor="#000066" />

 <Columns>

 <asp:CommandField HeaderText="编辑" ShowEditButton="True" />

 <asp:BoundField DataField="身份证号码" HeaderText="编号" ReadOnly="True" />

 <asp:BoundField DataField="姓名" HeaderText="姓名"  />

 <asp:BoundField DataField="出生日期" HeaderText="邮政编码"  />

 <asp:BoundField DataField="起薪" HeaderText="起薪"  DataFormatString="{0:C}" HtmlEncode="false"/>

 <asp:BoundField DataField="家庭住址" HeaderText="家庭住址"  />

 <asp:BoundField DataField="邮政编码" HeaderText="邮政编码" />

 </Columns>

 <RowStyle ForeColor="#000066" />

 <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />

 <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left"  CssClass="ms-formlabel DataGridFixedHeader"/>

 <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />

 </asp:GridView>

 </div>

 </form>

 </body>

 </html>
 

0
相关文章