stretch73
asked on
Set detailsView currentmode after an update
I'm trying to figure out how to set the mode of a detailsView after I perform an update. Right now everything works as far as clicking edit, altering a value, clicking update, and then seeing the new value but the detailsView is still in edit mode. I've tried several different things but I just can't get it to revert back. Please see attached code.
Thanks,
N
Thanks,
N
Protected Sub dvProjectDetails_ItemCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewCommandEventArgs) Handles dvProjectDetails.ItemCommand
If e.CommandName = "Update" Then
Dim projectDetailsAdapter As New ProjectDetailsAdapter
Try
projectDetailsAdapter.updateProjectDetails(sProjectID, sProjectTypeCode, sUserName)
Catch exError As Exception
lblErrorMessage.Text = "Error updating project details: " & exError.Message
lblErrorMessage.Visible = True
Finally
projectDetailsAdapter = Nothing
End Try
End If
End Sub
<asp:GridView
ID="gvProjects"
DataKeyNames="ProjectID"
EmptyDataText="no records found"
style="width:100%"
runat="server">
<Columns>
<asp:CommandField ShowSelectButton="true" ControlStyle-CssClass="btn" ButtonType="Button" ItemStyle-HorizontalAlign="center" />
<asp:BoundField DataField="ProjectID" HeaderStyle-Width="0%" HeaderText="Project ID" SortExpression="ProjectID" ItemStyle-HorizontalAlign="center" visible="false" />
</Columns>
</asp:GridView>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER