Here is the code too if you want to take a look at it. I used an if
statement just for debugging purpose. I tried to see if ChangeMode
statement needs to run twice in order to work properly but thats not
the case at all. For some odd reason you have to click button second
time in order to get the EditItemTemplate to appear. And after fighting
with this I am starting to give up. I debugged my pages even from
Page_Load() function and there is nothing that can be a problem or in a
way of this event. Thanks, for your help on this.
'If (FrmView.CurrentMode = FormViewMode.ReadOnly And Page.IsPostBack)
Then
FrmView.ChangeMode(FormViewMode.Edit)
Response.Write(FrmView.CurrentMode.ToString())
'End If
clickon wrote:
Why are you changing both the current mode and the default mode of the
formview to edit mode? Have you tried leaving the below line out?
FrmView.DefaultMode = FormViewMode.Edit
"Geek" wrote:
Guys,
I am working on a project, and I thought using FormView will help good
but I am running into a issue. What I have done is that in Form View in
Footer template icluded a Link Button which is servind as an edit
command. When user click it should change the Formview to Edit mode.
But when I click first on it is changing the mode to edit, it is not
diplaying the Edit Item template, I have to click again in order to get
into Edit Item template. This is getting little frustrating for me. Can
any one tell me what is going on here. Thanks,
Protected Sub LinkButton_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
FrmView.ChangeMode(FormViewMode.Edit)
FrmView.DefaultMode = FormViewMode.Edit
end sub