Solved

DetailsView Insert Command

Posted on 2008-06-15
1
507 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

623 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