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

Manipulate GridEditFormItem

1 Answer 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 22 Sep 2008, 03:23 PM
I am changing a grid from editform to edittemplate.  In the codebehind on the ItemDataBound event I am currently manipulating a field 'password' successfully by:$0$0$0$0$0 GridDataItem gridDataItem = e.Item as GridDataItem;$0$0 password = gridDataItem["password"].Text;$0$0gridDataItem["password"].Text = password blah blah blah;$0$0$0$0$0$0which works fine$0$0$0$0$0Now on the EditForm fields:$0$0$0$0$0The other fields in the edit form I am simply doing a <%# Bind("field") %>.$0$0$0$0$0$0but for the Password field, I'm guessing I need to 'copy' the GridEditItem value to the GridEditFormItem, but I'm not sure how?$0$0$0$0$0$0$0$0$0$0$0$0$0$0

1 Answer, 1 is accepted

Sort by
0
david
Top achievements
Rank 1
answered on 22 Sep 2008, 03:58 PM
I figured it out and its easy for reference$0$0$0$0$0       if (e.Item is GridEditFormItem && e.Item.IsInEditMode)$0$0       {$0$0          GridEditFormItem editItem = (GridEditFormItem)e.Item;$0$0          TextBox tbxPassword = (TextBox)editItem.FindControl("tbxPassword");$0$0$0$0$0          password = tbxPassword.Text;$0$0          password = Security.Decrypt(password, IV);$0$0$0$0$0          tbxPassword.Text = password;$0$0$0$0$0$0$0$0       }  $0$0
Tags
Grid
Asked by
david
Top achievements
Rank 1
Answers by
david
Top achievements
Rank 1
Share this question
or