473,748 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Delete, Confirm, Multiple DataGrid Problems

I am developing a web application that utilises multiple
grids, panels, validation controls etc on the same page.

I have added the appropriate code to pop up dialogs to
confirm delete in datagrids using the ItemCreated event,
template colums and the Button.Attribut es.Add
("onclick", "return confirm('Are you sure you wish to
delete this row?');"). This works fine in some instances
when you click on the delete button but not always.

I would also like to add multiple buttons in each row of
the datagrid with other confirmation messages. I have got
this to work but have the same problem that the
confirmation messages art not always displayed.

I have done extensive research into this and find that if
you have validation controls on the same page as a
datagrid or multiple datagrids on the same page using the
above delete methodolgy it is a known limitation (see
http://www.dotnet247.com/247referenc.../9/47917.aspx).

This article talks about using code similar to the code
below to get around the problem but does not go into any
detail.

---------------------------------------------------------

Let's suppose that your onsubmit event handler is named
MyOnSubmit().
Add the following onload event handler to your page:

var VSSubmit

function OnLoad() {
VSSubmit = __doPostBack;
__doPostBack = OnSubmit;
}

This saves a reference to __doPostBack in VSSubmit and
substitutes the
original reference with a reference to our own OnSubmit
handler, which has
the same signature as doPostBack:

function OnSubmit(eventT arget, eventArgument) {
MyOnSubmit();
VSSubmit(eventT arget, eventArgument);
}

This function calls your event handler before calling
__doPostBack via the
reference that we stored before.
This works perfectly on all relatively recent browsers,
including NS4.7

---------------------------------------------------------

Can anyone point me in the right direction to resolve my
problem?

TIA
Jul 19 '05 #1
0 2324

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1941
by: Richard Payne | last post by:
I am developing a web application that utilises multiple grids, panels, validation controls etc on the same page. I have added the appropriate code to pop up dialogs to confirm delete in datagrids using the ItemCreated event, template colums and the Button.Attributes.Add ("onclick", "return confirm('Are you sure you wish to delete this row?');"). This works fine in some instances when you click on the delete button but not always.
3
2792
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine, but users have requested a confirmation message pop up so the user can confirm the delete. I can not quite get this to work. Here are the facts: I am working in the Microsoft Development Environment 2003 (Version
6
4638
by: JenHu | last post by:
Hi experts, I want to add a delete button in my datagrid, and before it deletes from database, I want to have a confirm dialog box for this deletion. I am entry level to the vb.net, and don't know java or c#. The problem is, when I tested the program, there is no pop-up confirmation box for the deletion, can you show me what' wrong with this code? Thank you.
4
3030
by: DrData | last post by:
I'm working on an ASP.Net application written in C#. On one page, there are several datagrid controls used to display, edit and delete detail records relating to the master record also displayed on that page. Each row in each datagrid includes a Delete button (added at runtime by the code-behind page as a ButtonColumn) and an Edit button (added at runtime by the code-behind page as an EditCommandColumn). What is the quickest, easiest and...
2
1664
by: Lars Netzel | last post by:
Hi What events are there to do things in when I am on a row in a datagrid (bound from a dataset) and press Delete key... There's no Delete Event on the drig and I can't figure out if there are any events on the Dataset itself either.. I need to delete a row from the database when this happens
0
854
by: Richard Payne | last post by:
I am developing a web application that utilises multiple grids, panels, validation controls etc on the same page. I have added the appropriate code to pop up dialogs to confirm delete in datagrids using the ItemCreated event, template colums and the Button.Attributes.Add ("onclick", "return confirm('Are you sure you wish to delete this row?');"). This works fine in some instances when you click on the delete button but not always.
3
13750
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum. Everyone wants to do a java confirmation box when a user clicks the delete button. Fair enough, basic user design rules state that you should always confirm a delete action. There is also a consensus that the best way to do this is a template...
5
6701
by: Jeff User | last post by:
Hello ..NET 1.1, VS 2003, C# & asp.net I have tried to follow msdn instructions and samples but I can not get an event to fire for this button on the datagrid. There has to be something obvious missing here, but after 2 days I am ready to explode ! Please help. To create the Delete button I selected the grid in design view, clicked the "Columns" property and added the Delete button in the
2
1799
by: Iain | last post by:
Hi All I am witing a web app using Delphi developer 2006 (C# app) and I have a datagrid. Excuse the numptyness of the question. I have a datagrid with the ability to Insert, Edit/Update and Delete records. The following is the datagrid definition <asp:datagrid id="Livery" runat="server"
0
8822
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9528
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9359
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6072
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4592
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3298
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.