If you give the Command name as Delete.. It goes for the row command as it is a custom button and Looks for Row_deleting Event as give the command name as Delete which is like a inbuilt command name for gridview Delete..
Better Post your code before asking a question. So that person helping u will understand u r problem Clearly
Yahoo IM : dotnetruler
I am trying to keep Frequently Asked Questions in my blog
dotnetruler
Contributor
4230 Points
753 Posts
Re: gridview delete row command
Jan 28, 2009 04:32 PM|LINK
aspx code.. ID is key of my table
<
asp:linkbutton id="btnDelete" runat="server" commandargument='<%# Eval("ID") %>' commandname="Delete" onclientclick="return Confirm(this);">Delete</asp:linkbutton>CS Code
protected void GridView_RowCommand(object sender, GridViewCommandEventArgs e){
if (e.CommandName == "Delete")
int ID = Convert.ToInt32(e.CommandArgument);
}protected
void GridView_RowDeleting(object sender, GridViewDeleteEventArgs e){
BindData();
}
If you give the Command name as Delete.. It goes for the row command as it is a custom button and Looks for Row_deleting Event as give the command name as Delete which is like a inbuilt command name for gridview Delete..
Yahoo IM : dotnetruler
I am trying to keep Frequently Asked Questions in my blog