Articles in this section
Category / Section

How to show the password column in WinForms GridGroupingControl?

4 mins read

The password column character for the WinForms Grid Grouping control can be set by using the PasswordChar property. The password column character can also be set by using the QueryCellStyleInfo event handler also.

 

By using the GridColumnDescriptor:

In the following code example, the password character of the Password column is set by using the  PasswordChar property.

C#

//Sets the password column character by using the PasswordChar property of the TableDescriptor.
this.gridGroupingControl1.TableDescriptor.Columns["Password"].Appearance.AnyRecordFieldCell.PasswordChar = '*';

VB

'Sets the password column character by using the PasswordChar property of the TableDescriptor.
Me.gridGroupingControl1.TableDescriptor.Columns("Password").Appearance.AnyRecordFieldCell.PasswordChar = "*"c

By using the QueryCellStyleInfo Event:

In the following event handler, the password character of the Grid Grouping control is set for the Password column.

C#

//Event subscription
this.gridGroupingControl1.QueryCellStyleInfo += GridGroupingControl1_QueryCellStyleInfo; 
 
//Eventcustomization
private void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
    if (e.TableCellIdentity.Column != null && e.TableCellIdentity.Column.Name == "Password")
    {
        e.Style.PasswordChar = '*';
    }
}

VB

'Event subscription
AddHandler Me.gridGroupingControl1.QueryCellStyleInfo, AddressOf GridGroupingControl1_QueryCellStyleInfo 
 
'Eventcustomization
Private Sub GridGroupingControl1_QueryCellStyleInfo(ByVal sender As Object, ByVal e As GridTableCellStyleInfoEventArgs)
 If e.TableCellIdentity.Column IsNot Nothing AndAlso e.TableCellIdentity.Column.Name = "Password" Then
  e.Style.PasswordChar = "*"c
 End If
End Sub 

View Sample in GitHub

focus

 

Conclusion

I hope you enjoyed learning how to show the password column in WinForms GridGroupingControl.

You can refer to WinForms GridGrouping feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WinForms GridGrouping example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied