日期:2014-05-17 浏览次数:20481 次
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[0].Text = "******"; //假如Cells[0]是密码列 } }
------解决方案--------------------
当然哪列标题还是密码单不绑定密码字段,直接绑定“***”
//添加一个TemplateField列 <asp:GridView ID="GridView1" runat="server" ondatabound="GridView1_DataBound" AutoGenerateColumns="False"> <Columns> <asp:TemplateField HeaderText="密码"> <ItemTemplate> *** </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>