473,385 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.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.

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(eventTarget, eventArgument) {
MyOnSubmit();
VSSubmit(eventTarget, 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 2296

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

Similar topics

0
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...
3
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,...
6
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...
4
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...
2
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...
0
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...
3
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....
5
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...
2
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.