GrapeCity.Win.MultiRow Namespace > TextBoxCell Class : PasswordChar Property |
<LocalizableAttribute(True)> <SRCategoryAttribute("Behavior")> <SRDescriptionAttribute("Indicates the character to display for password input.")> <GcSerializationInternalImplAttribute(UseShadowProperty=True, ShadowPropertyName="PasswordCharImpl", GetMethodName="", SetMethodName="", DescriptorTypeName="GrapeCity.Framework.Xml.Serialization.ShadowSerializablePropertyDescritpor, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")> Public Property PasswordChar As Char
Dim instance As TextBoxCell Dim value As Char instance.PasswordChar = value value = instance.PasswordChar
[Localizable(true)] [SRCategory("Behavior")] [SRDescription("Indicates the character to display for password input.")] [GcSerializationInternalImpl(UseShadowProperty=true, ShadowPropertyName="PasswordCharImpl", GetMethodName="", SetMethodName="", DescriptorTypeName="GrapeCity.Framework.Xml.Serialization.ShadowSerializablePropertyDescritpor, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")] public char PasswordChar {get; set;}
Exception | Description |
---|---|
System.InvalidOperationException | When GcMultiRow's AllowClipboard property is true, and this property is in use when you try to perform cut or copy in this cell. |
The UseSystemPasswordChar property has precedence over the PasswordChar property. Whenever the UseSystemPasswordChar is set to true, the default system password character is used and any character set by PasswordChar is ignored.
When the PasswordChar property is in use, a cut or copy in the cell using the keyboard is not allowed and an System.InvalidOperationException is thrown. In this case, String.Empty is set in the clipboard, but in edit mode, the behavior is the same as the standard control.
Important: |
---|
When the TextBoxCell is in password mode because PasswordChar, UseSystemPasswordChar, or ReadOnly are true (or in use), the TextBoxCell is in restricted mode. In this mode, the ImeMode is disabled, but the current ImeMode is cached so that it can be restored if the TextBoxCell ever becomes unrestricted. From the designer perspective, the displayed ImeMode value is the actual value. |
private void Form1_Load(object sender, EventArgs e) { TextBoxCell textBoxCell1 = new TextBoxCell(); //If the text cannot display completely, a '......' string is shown at the end, hover over the cell, the whole text is shown in a tooltip. textBoxCell1.Ellipsis = MultiRowEllipsisMode.EllipsisEnd; textBoxCell1.EllipsisString = "......"; //Enter the edit mode, the text is selected. textBoxCell1.HighlightText = true; textBoxCell1.Value = "DELETE THIS STRING TO INPUT, ONLY 10 CHARACTERS ALLOWED"; textBoxCell1.MaxLength = 10; //The value is cast to lower case. textBoxCell1.CharacterCasing = CharacterCasing.Lower; TextBoxCell textBoxCell2 = new TextBoxCell(); //Input text in textBoxCell2, it is treated as a password, always displays '#'. textBoxCell2.PasswordChar = '#'; textBoxCell2.UseSystemPasswordChar = false; textBoxCell2.Value = "12345"; Template template1 = Template.CreateGridTemplate(new Cell[] { textBoxCell1, textBoxCell2 }, 160, AutoGenerateGridTemplateStyles.ColumnHeader | AutoGenerateGridTemplateStyles.RowHeaderAutoNumber); gcMultiRow1.Template = template1; gcMultiRow1.RowCount = 3; }
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Dim textBoxCell1 As New TextBoxCell() 'If the text cannot display completely, a '......' string is shown at the end, hover over the cell, the whole text is shown in a tooltip. textBoxCell1.Ellipsis = MultiRowEllipsisMode.EllipsisEnd textBoxCell1.EllipsisString = "......" 'Enter edit mode, the text is selected. textBoxCell1.HighlightText = True textBoxCell1.Value = "DELETE THIS STRING TO INPUT, ONLY 10 CHARACTERS ALLOWED" textBoxCell1.MaxLength = 10 'The value is cast to lower case. textBoxCell1.CharacterCasing = CharacterCasing.Lower Dim textBoxCell2 As New TextBoxCell() 'Input text in textBoxCell2, it is treated as a password, always displays '#'. textBoxCell2.PasswordChar = "#"c textBoxCell2.UseSystemPasswordChar = False textBoxCell2.Value = "12345" Dim template1 As Template = Template.CreateGridTemplate(New Cell() {textBoxCell1, textBoxCell2}) gcMultiRow1.Template = template1 gcMultiRow1.RowCount = 3 End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2