I want to create passwo开发者_Go百科rd field in Data Grid view in WinForm c# .NET.
How should i proceed?
If it's for creating a password and you must do it in the grid, just use plain text and clear it out once you create the account.
If you're building an app where a customer service rep builds an account for a user, either send the user a password you generate or use some default password for your company (I would only use this with internal-use-only software). Then force them to change it on the user's first login.
I can only assume you don't want the ability of your grid users to view passwords. If indeed that is the case, don't do it!!!
Try the following code. It may helpful to you.
protected void GridView1_PreRender1(object sender, EventArgs e)
{
foreach (GridViewRow row in GridView1.Rows)
{
string pwd = new string('*', row.Cells[2].Text.Length);
}
}
精彩评论