Wrox Programmer Forums
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 1st, 2009, 12:32 PM
Authorized User
Join Date: Jun 2006
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default Gridview Problem


I have gridview which has many rows.One row is button column,command name is "Delete".

protectedvoid GridView1_RowDeleted(object sender, GridViewDeleteEventArgs e)
int categoryID = (int)GridView1.DataKeys[e.RowIndex].Value;

call this method on OnRowDeleted="GridView1_RowDeleted" and OnRowDeleting="GridView1_RowDeleting"

But It gives an error:No overload for 'GridView1_RowDeleted' matches delegate 'System.Web.UI.WebControls.GridViewDeletedEventHan dler' in C# 2008

I am not getting what happened excetly?This code is running in vb.net successfully but not in c#.

pls help me it's urgent.

Old January 1st, 2009, 01:36 PM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

pls help me it's urgent.
Of course; it always is, or you wouldn't be posting it here. By adding that to your posts you often achieve the opposite.

Anyway, looks like you copied the handler for the Deleting event to the Deleted event without setting it up through the IDE. Take a look at this:

protected void GridView1_RowDeleted(object sender, GridViewDeleteEventArgs e)

This is the signature for the Deleting event. How can you tell? It has a GridViewDeleteEventArgs parameter, rather than a GridViewDeletedEventArgs (with an extra d):

Try this instead:

protected void GridView1_RowDeleted(object sender, GridViewDeletedEventArgs e)


Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Old January 1st, 2009, 03:26 PM
Registered User
Join Date: Aug 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gludhani
Default One easy sol by MS

MS should remove Ctrl+C and Ctrl+V or a person should have license to use these keys .

But then there would be no such sites to help people


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paging problem in gridview kalyanykk ASP.NET 3.5 Basics 1 December 8th, 2008 03:33 AM
problem in gridview jaber.moh ASP.NET 2.0 Basics 1 March 19th, 2007 02:47 AM
Gridview.SelectedRow problem toshesh ASP.NET 2.0 Professional 3 November 30th, 2006 01:01 PM
Problem in GridView mohsin_khan BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 November 15th, 2006 03:07 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.