We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

PasswordChar Property of Text in a DataGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

1526 Nov 7,2002 11:44 PM Nov 8,2002 03:13 AM Windows Forms 1
loading
Tags: GridControl
Escape Boy
Asked On November 7, 2002 11:44 PM

Hi to everyone... I'm just been battered by this situation. The case goes like this.. I have set a Bound DataGrid Table for System Access. But then as I display the Records, namely, {Name, Password, DateAccessed..}, the datagrid reflects the actual string password value of the Password field which should be in a passwordchar mode. It should be hidden in a Passwordchar Property of a text Object right? Is there any possible solution on how to use and trigger the PasswordChar Property of a certain field to a Datagrid... Thanks for reading.. I hope to receive any Reply from you people...

Administrator [Syncfusion]
Replied On November 8, 2002 03:13 AM

Essential Grid does not use the TextBox control as the basis for its TextBox cell, instead it uses the RichTextBox control which does not have a PassWord property. In a future release, we will be adding many additional celltypes, including a celltype that uses the Windows Forms textbox, and thus has a password property. If you just want to handle the display if the password, and not allow in-cell editing of the password, then you can handle the PrepareViewStyleInfo event and handle things there. If you do not set the Static celltype, then the cell will be editable, but it would show the old password when you start the edit. There are ways around this as well, but it would take more work.
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
	//password column
	if(e.RowIndex > 0 && e.ColIndex == 2 && e.Style.Text.Length > 0)
	{
		string s = new String('*', e.Style.Text.Length);
		e.Style.Text = s;
		e.Style.CellType = "Static";
	}
}

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;