Hello! I hope can help me ..
I need to show a confirmation message before the
Deleting a row, I tried this:
But the problem is that the first time I press the
button deletes the row, when I delete another row
It works and shows me the message.
That way I can show the confirmation message without
do a postback?
Thanks for your help!
Sincerly Briayan!
I need to show a confirmation message before the
Deleting a row, I tried this:
| <telerik:RadGrid ID="rgSucursales" runat="server" AllowPaging="True" AllowSorting="True" |
| GridLines="None" onneeddatasource="rgSucursales_NeedDataSource" |
| VirtualItemCount="1" onitemcommand="rgSucursales_ItemCommand" |
| onitemdatabound="rgSucursales_ItemDataBound" > |
| <PagerStyle FirstPageToolTip="Primera Página" /> |
| <MasterTableView PageSize="5"> |
| <Columns> |
| <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Editar" |
| ImageUrl="img/editar.png" Text="Editar Cuenta" UniqueName="column"> |
| </telerik:GridButtonColumn> |
| <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Eliminar" |
| ImageUrl="img/eliminar.png" Text="Eliminar Cuenta" UniqueName="EliminarColumna" > |
| </telerik:GridButtonColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings EnableAlternatingItems="False"> |
| <Selecting AllowRowSelect="False" /> |
| <ClientMessages PagerTooltipFormatString="Página <strong>{0}</strong> de <strong>{1}</strong>" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| protected void rgSucursales_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| string cmd = e.CommandName.ToString(); |
| if (cmd.Equals("Editar")) |
| { |
| Session["BANEDIT"] = item["Codigo"].Text; |
| rwSucursales.NavigateUrl = "~/OperCat.aspx"; |
| rwSucursales.Visible = true; |
| } |
| else if (cmd.Equals("Eliminar")) |
| { |
| GridDataItem item = (GridDataItem)e.Item; |
| ImageButton deleteBtn = (ImageButton)item["EliminarColumna"].Controls[0]; |
| deleteBtn.Attributes.Add("OnClick", "if(!confirm('¿Está seguro que desea Realizar la Venta?')){return false;};"); |
| var codigoEliminar = item["Codigo"].Text; |
| if (_dbase.DeleteQuery("Delete From tb where id_Bs=" + codigoEliminar).Equals("Ok")) |
| { |
| //Row deleted |
| "AlertSucess('#effect','¡La Cuenta ha sido eliminada!');", true); |
| } |
| else |
| { |
| //Problem in query |
| } |
| } |
| } |
But the problem is that the first time I press the
button deletes the row, when I delete another row
It works and shows me the message.
That way I can show the confirmation message without
do a postback?
Thanks for your help!
Sincerly Briayan!