Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

myDataGrid_DeleteCommand not being hit

Status
Not open for further replies.

organicg

Programmer
Oct 21, 2002
151
US
OK, so I:

Code:
Sub Page_Load
  If not IsPostBack Then BindData()
End Sub

Sub BindData()
  'query and bind the grid here
End Sub

Sub myDataGrid_DeleteCommand
 'row is deleted here
  BindData()
End Sub
I have a Delete button on the grid but myDataGrid_DeleteCommand breakpoint only gets hit if I DON'T include the IsPostBack in Page_Load. What's going on? Obviously, I don't want to BindData() before deleting the row first. BindData() should happen afterwards.
Thanks!
 
I use codebehind with 'Handles' keyword

Private Sub dgUploads_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgUploads.DeleteCommand

The column does have the required commandname="delete" attribute:
<asp:buttoncolumn Text="Delete" ButtonType="PushButton" CommandName="Delete"></asp:buttoncolumn>
 
Yes. I have the default aspx Page directive:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="FileManager.aspx.vb" Inherits="RMS.FileManager"%>

It's something related to whether I do or don't BindData()
 
Thanks for the offer.
I moved the 'admin' 'delete' grid functionality to the grid on an allow=anonymous page, simply showing the delete column if the admin is logged in, and now it works. I have no idea what was different about the page that I added the functionality to...but whatever.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top