This is a migrated thread and some comments may be shown as answers.

Password style **** in edit mode with auto generated columns

1 Answer 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Felice
Top achievements
Rank 1
Felice asked on 24 May 2014, 01:29 PM
Hi,
I am using the following snippet to hide the password in edit mode:

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
        {
            GridEditFormItem editItem = (GridEditFormItem)e.Item;
            TextBox txtpwd = (TextBox)editItem["password"].Controls[0];
            txtpwd.TextMode = TextBoxMode.Password;
 
            if (!(e.Item.DataItem is GridInsertionObject))
            {
                txtpwd.Attributes.Add("value", txtpwd.Text);
            }
 
        }
    }
The problem I have is that when I open the record for modification, the password disappear. How can I hide the password in edit mode having all auto generated columns?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 May 2014, 04:42 AM
Hi Felice,

I guess you want to hide the password column in edit mode, please try the following. If it doesn't help, elaborate on your requirement.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
  if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
  {
    GridEditFormItem editItem = (GridEditFormItem)e.Item;      
    editItem["password"].Parent.Visible = false;
  }
}

Thanks,
Princy
Tags
Grid
Asked by
Felice
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or