Campo passwordchar in una datagridview

lunedì 08 marzo 2010 - 23.20

aranello Profilo | Newbie

Chiedo un aiutino, ho impostato credo correttamente un campo specifico del datagrid in passwordchar="*"
e tutto funziona, ma come faccio ad estrarre il valore nascosto della password per poterla scrivere sul database.
Ecco il sorgente:
Private Sub DataGridView1_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting
If DataGridView1.Columns(e.ColumnIndex).Name.Equals("Column2") And DataGridView1.CurrentCell.RowIndex = 1 Then
If (Not e.Value Is Nothing) Then
DataGridView1.Rows(1).Cells(1).Value = New String(CChar("*"), Len(DataGridView1.Rows(1).Cells(1).Value))
End If
End If
End Sub

Private Sub DataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing
Dim TB As TextBox = CType(e.Control, TextBox)
If DataGridView1.CurrentCell.RowIndex = 1 And DataGridView1.CurrentCell.ColumnIndex = 1 Then
TB.PasswordChar = CChar("*")
Else
TB.PasswordChar = Char.MinValue
End If
End Sub
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5