0

I want to create password field in Data Grid view in WinForm c# .NET.

How should i proceed?

3

2 Answers 2

1

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!!!

1

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);
  }
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.