嗨...我在GRIDVIEW控件中遇到错误 [英] hi ... iam getting error in GRIDVIEW control

查看:77
本文介绍了嗨...我在GRIDVIEW控件中遇到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hiii ....



错误消息





错误6'asp.gridview_aspx'不包含'gvEG_RowCancelingEdit'的定义,并且没有扩展方法'gvEG_RowCancelingEdit'可以找到接受类型'ASP.gridview_aspx'的第一个参数(你是否缺少using指令或程序集引用?) E:\mine \WebSite8 \ GridView.aspx 12

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

推荐答案

您的错误信息描述了所有的事情......

你有创建了名为'gvEG_RowCancelingEdit'的事件,并且代码中没有方法。



如果你想要gridview的RowCancelEdit事件然后为其他明智的代码写代码删除来自aspx页面中gridview控件的事件名称。



Eg.-

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.-
<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#代码 - (添加此类活动)






C# code -(Add event like this)

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







或删除: -




or remove :-

onrowcancelingedit="CustomersGridView_RowCancelingEdit


如果您不需要此事件,则来自gridview的


from gridview if you not required this event.


在您的cs文件中,提及事件: -



In your cs file, mention the event:-

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

<另外,在aspx页面中,





Also, in the aspx page,

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





希望他会帮助你:)。



Hope this helps you :)


这篇关于嗨...我在GRIDVIEW控件中遇到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆