Solved

DetailsView Insert Command

Posted on 2008-06-15
1
502 Views
Last Modified: 2013-11-07
Is there a way to call the 'New' button on the detailsview within another function or button ?

I am using it for inserts in addition to a gridview and would like to a button to make the detailsview visible then auto-call the insert function;. so the user doesn't feel like they are dealing with two grids even though one is only doing inserts since the gridview isn't real good at inserts.

I've tried simulating this command which seems to be the reference but had had no luck.
javascript__dopostback('DetailView1','New$0')

Also; I know there are ways to get the gridview to show a footer/ union query etc but I've decided this might be my best route since my tables under the grid will be dynamic and changing based on a dropdown.

Thanks for any helpt
0
Comment
Question by:sny23vpb
1 Comment
 
LVL 21

Accepted Solution

by:
naspinski earned 125 total points
ID: 21790545
just make a linkbutton or button with this as the code-behind
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        DetailsView1.ChangeMode(DetailsViewMode.Insert);
    }

Open in new window

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question