Solved

DetailsView Insert Command

Posted on 2008-06-15
1
494 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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 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

11 Experts available now in Live!

Get 1:1 Help Now