找回密码
 立即注册

QQ登录

只需一步,快速开始

wqj

银牌会员

3

主题

15

帖子

3045

积分

银牌会员

积分
3045

活字格认证

最新发帖
wqj
银牌会员   /  发表于:2013-8-14 09:29  /   查看:9015  /  回复:10
C1GridView无法触发rowupdating
前台:
<cc1:C1GridView ID="C1GridView1" runat="server" VisualStyle="Office2007Blue" AutoGenerateColumns="False"
        PageSize="30" AllowPaging="True" Width="100%" VisualStylePath="~/C1WebControls/VisualStyles"
        OnPageIndexChanging="C1GridView1_PageIndexChanging" OnRowCancelingEdit="C1GridView1_RowCancelingEdit"
        OnRowEditing="C1GridView1_RowEditing" OnRowUpdating="C1GridView1_RowUpdating"
        OnRowDeleting="C1GridView1_RowDeleting" OnRowCreated="C1GridView1_RowCreated"
        DataKeyNames="VendorID">...........
<cc1:C1CommandField CausesValidation="false" ShowEditButton="True" ShowDeleteButton="True" ButtonType="Image"
                EditImageUrl="../../img/edit.gif" CancelImageUrl="../../img/cancel.gif" DeleteImageUrl="../../img/delete.gif"
                UpdateImageUrl="~/img/accept.gif" HeaderText="操作">
            </cc1:C1CommandField>
后台:
protected void C1GridView1_RowEditing(object sender, C1GridViewEditEventArgs e)
        {
            C1GridView1.EditIndex = e.NewEditIndex;
            UpdateView();
        }
        protected void C1GridView1_RowCancelingEdit(object sender, C1GridViewCancelEditEventArgs e)
        {
            C1GridView1.EditIndex = -1;
            UpdateView();
        }
        protected void C1GridView1_RowUpdating(object sender, C1GridViewUpdateEventArgs e)
        {
            C1GridView1.DataSource = GetDataSet();
            C1GridView1.Update();

            DE.SP_VendorEntityTableAdapters.SP_VendorTableAdapter da = new DE.SP_VendorEntityTableAdapters.SP_VendorTableAdapter();
            da.Update(dt);
            C1GridView1.EditIndex = -1;
            UpdateView();
        }
        protected void C1GridView1_RowDeleting(object sender, C1GridViewDeleteEventArgs e)
        {

            dt.DefaultView[e.RowIndex + (C1GridView1.PageIndex * C1GridView1.PageSize)].Delete();
            DE.SP_VendorEntityTableAdapters.SP_VendorTableAdapter da = new DE.SP_VendorEntityTableAdapters.SP_VendorTableAdapter();
            da.Update(dt);
            UpdateView();
        }
都写了,就是触发不了rowupdating事件,帮忙分析一下。。

10 个回复

倒序浏览
gw0506
超级版主   /  发表于:2013-8-14 11:38:00
沙发
你用的是什么版本? 2012还是2013?
回复 使用道具 举报
wqj
银牌会员   /  发表于:2013-8-14 12:02:00
板凳
回复 2楼gw0506的帖子

C1StudioASPNET_2011v3.msi 比较老
回复 使用道具 举报
gw0506
超级版主   /  发表于:2013-8-14 12:16:00
地板
没关系。
暴露的接口一般不会出现问题。我想知道你的操作步骤。是否有异常抛出?
回复 使用道具 举报
wqj
银牌会员   /  发表于:2013-8-14 13:37:00
5#
回复 4楼gw0506的帖子



1.点击EDIT
2.修改文本
3.点击√
无法触发RowUpdating事件

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
gw0506
超级版主   /  发表于:2013-8-14 13:49:00
6#
你是绑定模式还是非绑定模式?是否将C1GridView绑定到了DataSourece。

RowUpdating和RowUpdated事件都是在绑定模式下生效。
回复 使用道具 举报
wqj
银牌会员   /  发表于:2013-8-14 14:34:00
7#
回复 6楼gw0506的帖子

private void UpdateView()
        {
            GetDataSet();
            C1GridView1.DataSource = dt;
            C1GridView1.DataBind();
        }
回复 使用道具 举报
wqj
银牌会员   /  发表于:2013-8-14 14:52:00
8#
你是绑定模式还是非绑定模式?是否将C1GridView绑定到了DataSourece。

RowUpdating和RowUpdated事件都是在绑定模式下生效。
gw0506 发表于 2013-8-14 13:49:00

原因是浏览器的问题!!!
不支持IE11...
回复 使用道具 举报
gw0506
超级版主   /  发表于:2013-8-14 15:04:00
9#
你都用到IE11了?!!!
IE11现在应该还没有正式发布吧?
回复 使用道具 举报
wqj
银牌会员   /  发表于:2013-8-14 15:23:00
10#
你都用到IE11了?!!!
IE11现在应该还没有正式发布吧?
gw0506 发表于 2013-8-14 15:04:00

之前自己下了个Beta的,一直忘记了。。。
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部