title: How to create column of type password in gridview?
body: <p>I am creating an application in which user selects files and provides credentials to open that file. For that I have created three columns in a gridview.<br>
  User enters password in password column.<br>
  I want to display <strong><code>*</code></strong> in place of characters like we can create a textbox of password type.<br>
  I have tried this code on <code>GridView_CellClick</code> event :</p>
  
  <pre><code>if (GridView.Columns[e.ColumnIndex].HeaderText == "Password")
  { 
     txtPassword[e.RowIndex] = new TextBox();
     txtPassword[e.RowIndex].Name = "txtPassword"+e.RowIndex;
     txtPassword[e.RowIndex].PasswordChar = '*';
     txtPassword[e.RowIndex].Visible = true;
     txtPassword[e.RowIndex].TextChanged += new      
  
     if (GridView.CurrentCell.Value == null)
        txtPassword[e.RowIndex].Text = "";
     else
        txtPassword[e.RowIndex].Text = GridView.CurrentCell.Value.ToString();
  
     txtPassword[e.RowIndex].Location = GridView.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex + 1, false).Location;
  
     txtPassword[e.RowIndex].Size = GridView.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex + 1, false).Size;
  
     txtPassword[e.RowIndex].Visible = true;
     txtPassword[e.RowIndex].Focus();
  } 
  </code></pre>
  
  <p>But in above solution characters are displayed.<br>
  How can I solve this problem?</p>