Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

DetailsView won't enter Edit mode?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 02 Jul 2007 19:56 GMT
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??
> }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.