Click here to Skip to main content
15,900,258 members
Home / Discussions / C#
   

C#

 
GeneralRe: Develop Windows Application with Add-Ins Pin
Charlie Williams23-Sep-04 11:03
Charlie Williams23-Sep-04 11:03 
GeneralRe: Develop Windows Application with Add-Ins Pin
Roger Stewart23-Sep-04 11:08
professionalRoger Stewart23-Sep-04 11:08 
GeneralRe: Develop Windows Application with Add-Ins Pin
shawaj23-Sep-04 12:54
shawaj23-Sep-04 12:54 
GeneralRe: Develop Windows Application with Add-Ins Pin
Nnamdi Onyeyiri23-Sep-04 13:21
Nnamdi Onyeyiri23-Sep-04 13:21 
GeneralNullReferenceException Pin
Anonymous23-Sep-04 9:49
Anonymous23-Sep-04 9:49 
GeneralRe: NullReferenceException Pin
Heath Stewart23-Sep-04 10:20
protectorHeath Stewart23-Sep-04 10:20 
GeneralPassword Textbox for Datagrid Pin
macsgirl23-Sep-04 8:45
macsgirl23-Sep-04 8:45 
GeneralRe: Password Textbox for Datagrid Pin
Heath Stewart23-Sep-04 11:37
protectorHeath Stewart23-Sep-04 11:37 
Yes, but you'll either need to implement your own DataGridColumnStyle or extend the DataGridTextBoxColumn. You could define a PasswordChar property, which would look something like this:
public class DataGridPasswordColumn : DataGridTextBoxColumn
{
  public DataGridPasswordColumn()
  {
    TextBox.PasswordChar = '*';
  }
  [DefaultValue('*')]
  public virtual char PasswordChar
  {
    get { return TextBox.PasswordChar; }
    set { TextBox.PasswordChar = value; }
  }
}
This encapsulates the functionality easily in your DataGridPasswordColumn which you can instantiate and add instances of it to the DataGridTableStyle used by the DataGrid.TableStyles collection property.

You could also do this without implementing your own DataGridColumnStyle derivative. In your Form, UserControl, or whatever you're doing this in set the specific DataGridTextBoxColumn's TextBox.PasswordChar property. You do not do this for each row, though; the same DataGridColumnStyle derivative is used when a particular cell is editted.

If you want more information on DataGridColumnStyles, search this site for a handful of decent articles about how to implement your own, or read the documentation for the class which includes a sample implementing a column style with a DateTimePicker control.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles]
General.NET load of DLL in privatePath failing -- HELP!!!! Pin
LongRange.Shooter23-Sep-04 8:19
LongRange.Shooter23-Sep-04 8:19 
GeneralRe: .NET load of DLL in privatePath failing -- HELP!!!! Pin
Heath Stewart23-Sep-04 10:41
protectorHeath Stewart23-Sep-04 10:41 
GeneralRe: .NET load of DLL in privatePath failing -- HELP!!!! Pin
LongRange.Shooter23-Sep-04 11:07
LongRange.Shooter23-Sep-04 11:07 
GeneralRe: .NET load of DLL in privatePath failing -- HELP!!!! Pin
Heath Stewart23-Sep-04 11:21
protectorHeath Stewart23-Sep-04 11:21 
GeneralRe: .NET load of DLL in privatePath failing -- HELP!!!! Pin
LongRange.Shooter24-Sep-04 4:40
LongRange.Shooter24-Sep-04 4:40 
GeneralRe: .NET load of DLL in privatePath failing -- HELP!!!! Pin
Heath Stewart24-Sep-04 5:36
protectorHeath Stewart24-Sep-04 5:36 
GeneralRe: Basic EventHandling Question Pin
Heath Stewart23-Sep-04 7:21
protectorHeath Stewart23-Sep-04 7:21 
GeneralRe: Basic EventHandling Question Pin
SandeepN23-Sep-04 8:49
SandeepN23-Sep-04 8:49 
GeneralRe: Basic EventHandling Question Pin
Heath Stewart23-Sep-04 10:53
protectorHeath Stewart23-Sep-04 10:53 
GeneralRe: Basic EventHandling Question Pin
SandeepN24-Sep-04 4:32
SandeepN24-Sep-04 4:32 
GeneralHowto: Lock my ArrayList collection. Pin
matthias s.23-Sep-04 6:47
matthias s.23-Sep-04 6:47 
GeneralRe: Howto: Lock my ArrayList collection. Pin
Heath Stewart23-Sep-04 7:34
protectorHeath Stewart23-Sep-04 7:34 
GeneralRe: Howto: Lock my ArrayList collection. Pin
Werdna23-Sep-04 10:29
Werdna23-Sep-04 10:29 
GeneralBasic EventHandling Question Pin
SandeepN23-Sep-04 6:42
SandeepN23-Sep-04 6:42 
GeneralInterfacing with C Vendor DLLs Pin
Evelyne23-Sep-04 4:53
Evelyne23-Sep-04 4:53 
GeneralRe: Interfacing with C Vendor DLLs Pin
Heath Stewart23-Sep-04 6:58
protectorHeath Stewart23-Sep-04 6:58 
GeneralRe: Interfacing with C Vendor DLLs Pin
Evelyne23-Sep-04 8:47
Evelyne23-Sep-04 8:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.