When I click the "Edit" hyperlink, my DetailsView doesn't enter Edit mode.
It will if I set the DefaultMode="Edit". Any thoughts? Thanks.
<asp:DetailsView ID="DetailsView1" DataKeyNames="TopicId" runat="server"
Height="50px" Width="547px" AutoGenerateEditButton=true
OnModeChanging="DetailsView1_ModeChanging"
OnPageIndexChanging="DetailsView1_PageIndexChanging">
</asp:DetailsView>
protected void DetailsView1_ModeChanging(Object sender,
DetailsViewModeEventArgs e)
{
//do I need to do something here??
}
David R. Longnecker - 02 Jul 2007 22:25 GMT
You'll need to have an event for your Edit hyperlink that sets you into Edit
mode.
If you're using Commands, you could capture the CommandName.Equals("Edit")
of your ItemCommand event and then run:
protected void DetailsViewObject_ItemCommand(object sender, DetailsViewCommandEventArgs
e)
{
if (e.CommandName.Equals("Edit"))
{
DetailsViewObject.ChangeMode(DetailsViewMode.Edit);
}
}
Or simply anything that fires off the ChangeMode method. After you're done
editing, be sure to swap back to .ReadOnly when you're done.
HTH.
-dl
--
David R. Longnecker
http://blog.tiredstudent.com
> When I click the "Edit" hyperlink, my DetailsView doesn't enter Edit
> mode. It will if I set the DefaultMode="Edit". Any thoughts? Thanks.
[quoted text clipped - 10 lines]
> //do I need to do something here??
> }