Solved

DetailsView Insert Command

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

838 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