【问题标题】:Buttons inside the Devexpress Gridview is not respondingDevexpress Gridview 中的按钮没有响应
【发布时间】:2020-01-03 12:55:29
【问题描述】:

我需要在使用 GridViewCommandColumnCustomButton 属性创建的删除按钮上设置确认消息。 将客户端事件添加到我的网格后,其他按钮(在同一个 AspxGridview 内)不会触发事件,但 Delete 按钮除外。

我为消息创建的事件是:

grid.ClientSideEvents.CustomButtonClick = "function (s, e) { if (e.buttonID == 'DELETE'){ e.processOnServer = confirm('Are you sure you want to delete this item?'); }}";

如果我从服务器端删除所有按钮触发事件的代码并按预期工作,但如果我添加上述代码,删除按钮将正常工作,但其他按钮不会触发任何事件。

PS:所有的按钮也是用同样的方式创建的

【问题讨论】:

    标签: asp.net devexpress


    【解决方案1】:

    我更新了如下代码。现在它起作用了。

    grid.ClientSideEvents.CustomButtonClick = "function (s, e) { if (e.buttonID == 'DELETE'){ e.processOnServer = confirm('Are you sure you want to delete this Voucher?');} "+
                                                          " else if  (e.buttonID == 'EDIT'){ e.processOnServer = true; } " +
                                                          " else if  (e.buttonID == 'UPDATE'){ e.processOnServer = confirm('Are you sure you want to Update this Voucher?'); }  }";
    

    除了任何简单的答案,请分享!

    谢谢:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-24
      • 2017-12-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多