Solved

DetailsView Insert Command

Posted on 2008-06-15
1
497 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now