471,317 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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(ButtonColumn
delete) on WebForms.
code button HTML which opens pop-up:
<INPUT class="buttonForm"
onclick="MM_openBrWindow('../pages/recherche_ar.aspx?a=2','AR','width=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, DataGridCommandEventArgs e)
{
String ID;
switch(e.CommandName)
{
case "Delete":
ID = e.Item.Cells[0].Text;
delDepartementale(ID);
getListAdherents("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="javascript">
refreshmainwindow();
</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 refreshmainwindow();

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_load) How can one remove the actions which it keeps in memory
so that he does not re-execute them in the function refreshmainwindow();
Dec 14 '05 #1
0 1379

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by clyyy2002 | last post: by
3 posts views Thread by vinayak | last post: by
reply views Thread by Curtis Hatter | last post: by
4 posts views Thread by Jeff User | last post: by
1 post views Thread by thebison | last post: by
9 posts views Thread by rn5a | last post: by
1 post views Thread by mero | last post: by
reply views Thread by rosydwin | last post: by

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.