The above piece of code will also do the same as label in Item Template and Textbox in the Edit Item Template.
By default all the boundfields will be trasferred as Textboxes in Edit Mode.
If you make a simple gridview with 2 columns and make both columns visible, you cn use the code below to get the value.
How can I force it to retrieve the data and now show the value.To avoid this we need to keep the property Read Only as false, Then in the edit mode nothing will happenes. The reason I use Template Field instead of Bound Field is that, it is very easy to grab those controls in the codebehind if we user labels or textboxes.In case of the bound field’s we need to check what column it is and need to use index of that cloumn, which is little hard and even in future if we change the column order If you see the Last Template Field part in the above code, I am using the link buttons for edit, update, delete and cancel.This has the added benefit of saving off the real value of the field rather than the To String() representation of the value.I understand your reasons to not databind hidden fields and use Data Keys array instead. Are you setting the Data Source property rather than the Data Source ID property? Right, it doesn't work only if Data Source property assgined.