473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

DetailsView won't enter Edit mode?

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_PageIndexChangin g">
</asp:DetailsView>

protected void DetailsView1_ModeChanging(Object sender,
DetailsViewModeEventArgs e)
{
//do I need to do something here??
}
Jul 2 '07 #1
1 6873
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.

<asp:DetailsView ID="DetailsView1" DataKeyNames="TopicId"
runat="server" Height="50px" Width="547px"
AutoGenerateEditButton=true OnModeChanging="DetailsView1_ModeChanging"
OnPageIndexChanging="DetailsView1_PageIndexChangin g">
</asp:DetailsView>

protected void DetailsView1_ModeChanging(Object sender,
DetailsViewModeEventArgs e)
{
//do I need to do something here??
}

Jul 2 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
1
by: sck10 | last post by:
Hello, I am trying to change a value when a user goes into edit mode on a DetailsView control. I am trying to use the following, but can not figure out how to get to the bound field...
0
by: mike | last post by:
Hi, When I programatically Bind a DataSource to DetailsView it does not fire "ModeChanged" event. This is first time i am trying to use ASP.NET DetailsView control. I have played with some of the...
1
by: cannontrodder | last post by:
I am using a custom business object to deal with inserting, editing, deleting and adding new users to my site which uses the membership class. When I add a new user, it can fail due to the user...
1
by: Mark Stafford | last post by:
I am attempting to use a DetailsView control to view some data where the fields returned by the database are determined at runtime. I create the TemplateFields on the fly using a class that...
2
by: rockdale | last post by:
Hi, I am upgrading my asp.net 1.x to asp.net 2.0. In my page I have a datagrid and a group of textbox, dropdownlist, checkbox... etc. the datagrid and the group of controls are hooked up - when...
1
by: Timothy H. Schilbach | last post by:
Hi Everyone, I am having a massive issue trying to get custom data into my DV. What I want to do is sooo simple: 1. I have a single DV on a page 2. I created my own template (see below) 3....
0
by: Andreas Wöckl | last post by:
HI Group! I am really getting crazy with my DetailsView. I have the following code initializing the Page where the DetailsView is in it: If Session("firmaNr") = 0 Then...
3
by: Don | last post by:
I have a detailsView that I use with a GridView. When a row is selected I show the GridView with a default mode of Edit. This shows my fields with text boxes for changing the data. It also has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.