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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

StyleInfo.PasswordChar only masks the password text, users can still copy-paste to notepad and see the actual password

Thread ID:





31038 Jun 29,2005 09:47 AM UTC Mar 17,2006 04:49 AM UTC WinForms 4
Tags: GridControl
Salil Khedkar
Asked On June 29, 2005 09:47 AM UTC

Hi there, I am using SyncFusion Grid v2.0.5.1. I do Syncfusion.Windows.Forms.Grid.GridBoundColumn.StyleInfo.PasswordChar = ''*''; to make my password column masked with * character. This acheives the purpose of hiding the password. But if a user copy-pastes the field in notepad, the actual unmasked password is naked for him. This is reported a severe bug in my software. Please let me know how can I protect the password fields in SyncFusion grid. Please note that I am encrypting passwords before saving to persistent storage. Regards, Salil

Administrator [Syncfusion]
Replied On June 29, 2005 10:04 AM UTC

One way you can handle this is to subscribe to the grid.Model.ClipboardCanCopy event, and do not allow the copy if the selections intersect your password column.
this.gridDataBoundGrid1.Model.ClipboardCanCopy += new GridCutPasteEventHandler(Model_ClipboardCanCopy);

private void Model_ClipboardCanCopy(object sender, GridCutPasteEventArgs e)
	int colIndex = this.gridDataBoundGrid1.Binder.NameToColIndex("passwordCOL");
		e.Handled = true;
		e.Result = false;

Replied On March 16, 2006 12:30 PM UTC

hi Can u solve this in GGC Thanks

Administrator [Syncfusion]
Replied On March 16, 2006 03:29 PM UTC

Hi, Please refer to the code snippet below, that demonstrates this functionality for the GGC. Let us know if you need more information on this. //this.gridGroupingControl1.TableControl.Model.ClipboardCanCopy += new GridCutPasteEventHandler(Model_ClipboardCanCopy); void Model_ClipboardCanCopy(object sender, GridCutPasteEventArgs e) { int col = this.gridGroupingControl1.TableModel.NameToColIndex("PasswordCol"); GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell; GridRangeInfo range = this.gridGroupingControl1.TableModel.Selections.Ranges.ActiveRange; // a range of cells if(range == GridRangeInfo.Empty) this.gridGroupingControl1.TableModel.Selections.Ranges.Add(GridRangeInfo.Cell(cc.RowIndex,cc.ColIndex)); // single cell if (this.gridGroupingControl1.TableModel.Selections.Ranges.AnyRangeIntersects(GridRangeInfo.Col(col))) { e.Handled = true; e.Result = false; } } Thanks for choosing Syncfusion Products. Best regards, Madhan.

Replied On March 17, 2006 04:49 AM UTC

thanks its working


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon