Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hiii....

error message


Error 6 'ASP.gridview_aspx' does not contain a definition for 'gvEG_RowCancelingEdit' and no extension method 'gvEG_RowCancelingEdit' accepting a first argument of type 'ASP.gridview_aspx' could be found (are you missing a using directive or an assembly reference?) E:\mine\WebSite8\Gridview.aspx 12
Posted
Comments
Sergey Alexandrovich Kryukov 25-Jul-14 3:28am    
Okay, you screwed up some code, so what? How can we know where?
—SA

your error message describe all things that..
you have created event with the name 'gvEG_RowCancelingEdit' and there is no method in your code.

if you want to RowCancelEdit event of gridview then write code for that other wise remove the event name from gridview control in aspx page.

Eg.-
VB
<asp:gridview id="CustomersGridView"
        datasourceid="CustomersSqlDataSource"
        autogeneratecolumns="true"
        autogenerateeditbutton="true"
        allowpaging="true"
        datakeynames="CustomerID"
        onrowcancelingedit="CustomersGridView_RowCancelingEdit"
        onrowediting="CustomersGridView_RowEditing"
        onrowupdated="CustomersGridView_RowUpdated"
        runat="server">
      </asp:gridview>



C# code -(Add event like this)

C#
protected void TaskGridView_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
 {
   //Reset the edit index.
   TaskGridView.EditIndex = -1;
 }



or remove :-
onrowcancelingedit="CustomersGridView_RowCancelingEdit

from gridview if you not required this event.
 
Share this answer
 
Comments
Raje_ 25-Jul-14 9:10am    
+5 for correct explanation..
In your cs file, mention the event:-

C#
protected void gvEmployee_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
       {
           gvEG.EditIndex = -1;
       }


Also, in the aspx page,

VB
<asp:GridView ID="gvEmployee" runat="server" 
                        onrowcancelingedit="gvEG_RowCancelingEdit">


Hope this helps you :)
 
Share this answer
 
v2
Comments
Raje_ 25-Jul-14 9:09am    
It seems some one down voted you...
+5 from me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900