473,657 Members | 2,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem to add and delete with a DataGrid

Environment: VS NET 2003 Fr
Framework: 1.1
OS: WinXP SP2 Fr

Hello
I have a problem to add with pop-up and to delete in a datagrid(Button Column
delete) on WebForms.
code button HTML which opens pop-up:
<INPUT class="buttonFo rm"
onclick="MM_ope nBrWindow('../pages/recherche_ar.as px?a=2','AR','w idth=700,height =500,scrollbars =yes,resizable= yes')"
type="button" value="Ajouter" >

code which removes the record with the ButtonColumn in the datagrid:
public void Grid_DataGrid1( Object sender, DataGridCommand EventArgs e)
{
String ID;
switch(e.Comman dName)
{
case "Delete":
ID = e.Item.Cells[0].Text;
delDepartementa le(ID);
getListAdherent s("ORDER BY nom ASC");
break;
}
}

code of the popup which refresh the window mother:
code behind:
Panel1.Visible= true;
code asp page:
<asp:Panel id="Panel1" runat="server" Visible="False" >
<SCRIPT language="javas cript">
refreshmainwind ow();
</SCRIPT>
</asp:Panel>

The problem:
1)I had a record with the pop-up
2)I delete a record in datagrid with ButtonColumn
3)If I had an other record with the pop-up, E ask:
The page cannot be refreshed without resending the information. Click Retry
to send the information again, or click, Cancel to return to the page that
you were trying to view.

If I click Retry:
It add the new record in the Datagrid (page_load) and automatically
re-execute the command to delete in datagrid.
If I click Cancel:
The datagrid is not refresh.

How can I delete the command which it keept in memory and re-execute with
the command refreshmainwind ow();

Thanks
.. If one adds a recording via the popone then that one removes a recording
via the column bond of the datagrid, and finally if one adds a new recording
in the popup, then IE say: The page cannot be brought up to date without the
reference of information. Click on Recommencer to return information... If
one clicks on starting again: It adds the recording in the datagrid
(page_load) then automatically re-executes the order to remove which it kept
in memory. If one clicks on Annuler, it rafraichit not the
datagrid(page_l oad) How can one remove the actions which it keeps in memory
so that he does not re-execute them in the function refreshmainwind ow();
Dec 14 '05 #1
0 1500

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

Similar topics

3
1640
by: clyyy2002 | last post by:
At added two column and more column hereafter,I immediately click del button,the program is no problem. but if i first click the DataGrid columnHeader and then click the del button, i find when column is finally ,a error is happen underside is my program.
3
4911
by: vinayak | last post by:
Hi I am displaying data in Datagrid in ASP.NET with Edit/Update functionality for each row. On the same page I have 2 Button controls which submits the request to server. These button controls are Web Control & not HTML control. One of these buttons whose title is Delete is added on the aspx page in design view & also I double clicked on this button in design view to get the onclick code for this button in the code behind page. & for...
0
317
by: Curtis Hatter | last post by:
I apologize if this has been answered, but on the .NET 247 site I saw a thread titled "Datagrid's ItemCommand Event", and had similar troubles with the Datagrid not properly firing the delete event if using a push button. I could not find the thread here, so I'm posting my finding's here in hopes that it will help others that are having the same problem. The problem: In a DataGrid the "Delete" command does not fire properly from a...
2
1660
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
4
2124
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a Delete button on the end of each row. I am unable to gain access to the event when the button is clicked. I don't fully understand how the click gets connected to the C# code,
1
1442
by: thebison | last post by:
Hi all, I hope someone can help with this relatively simple problem. I am building a timesheet application using ASP.NET C# with Visual Studio 2003.As it is only a protoype application, my database has been made in MSDE. I have a DataGrid, and have inserted a delete link button into it through Property Builder. My Delete method works fine, however I would like to insert a JScript popup to confirm, as otherwise users can just
9
2714
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the code: <script runat="server"> Dim sqlConn As New SqlConnection(".....") Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) If Not (Page.IsPostBack) Then FillDataGrid()
2
1978
by: Iain | last post by:
Hi All Using Delphi 2006 developer - C# Project I have the following 2 event handlers for the datagrid - see botton of page Both events will fire off correctly but i have a problem collecting the correct data in teh Update event - I have noted the problem in the event handler
1
1102
by: mero | last post by:
hi to all; i have in my site a datagrid that is used to show the data about the user who registered to the site(lastname,firstname,...). the idea from this datagrid that the admin can view the data of each person who is registered to the site, and then he can choose one of them and delete him. what i did is that in the final column i put a link button (btndelete) named "delete" in each row so when the admin click on the delete button ,...
0
8399
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8312
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
8732
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
8606
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7337
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6169
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4159
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...
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
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.