PasswordChar on TextBox in DataGridTextBoxColumn

  • Thread starter Brandon Owensby
  • Start date
B

Brandon Owensby

I have used PasswordChar on a TextBox that is on a form and it works great.
You see * instead of the password and you can't cut or copy the password
out. It doesn't work as well for a DataGrid. If you want to look a list of
users it would be the natural thing to want to hide the password. The setup
seems to indicate you can set the PasswordChar propery even on a TextBox in
the DataGridTextBoxControl so I assumed it would be ok. When you go to edit
the value for that column it will show up as the character you provided and
it won't let you cut the value out...but it will let you copy it...that is
unless you use the context menu to do it. Is this a known problem? Will it
be fixed in the next release? What do I do? Also...this isn't as big of a
problem because I have the columnstyle overridden and I was able to fix this
myself...the chosen character only masks the value when you are trying to
edit it. If you move the cursor to another cell then that cell that was
previously masked becomes unmasked.

Thanks in advance for any help you may provide,
Brandon
 
C

Claes Bergefall

Tha's because the textbox (with the password character) is only visible
for the current cell. As soon as you leave a cell the content is simply
painted by the DataGridTextBoxColumn.Paint method

..NET 2.0 provides a new grid control that might work
better in this scenario.

/claes
 
B

Brandon Owensby

Thanks for your message but I already knew what you told me about the
painting. If you read my message again you will see I have already fixed
that part of the problem. I was just wanting to say I noticed that problem
too so that I might find out if microsoft has already done something about
it. I wondered if 2.0 would help with either of my two problems but I had
no proof. The main problem is the copying and pasting. Whats the point in
masking the password if someone can just copy it then paste it anywhere to
see it...like notepad. This is an issue we'd like dealt with sooner than
later so we can deliver this to the client.

Thanks,
Brandon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top