【问题标题】:MouseLeftButtonDownEvent problemMouseLeftButtonDownEvent 问题
【发布时间】:2011-05-24 15:48:59
【问题描述】:

我在 Telerik 网格中有以下格式的行。

| WordFile.doc|button1|_button2_|

当用户单击第 1 列 [WordFile.doc] 时,我需要显示一个弹出窗口。我在数据网格行中有两个按钮,它们附加了点击事件。较早的 mousedoubleclick 事件已附加到行,一切正常。

现在为了使该行响应单击。我在后面的代码中添加了以下语句

this.radUSBFiles.AddHandler(GridViewCell.MouseLeftButtonDownEvent, new MouseButtonEventHandler(row_MouseDoubleClick), true);

在此之后按钮停止工作。我相信 MouseLeftButtonDownEvent 不会让控件到达按钮的事件处理程序。

我正在尝试计算点击发生的列号,如果点击发生在按钮列以外的任何区域,则将 Handled 设置为 true。

有没有更好的方法来解决这个问题?

请指教,

问候,

约翰。

【问题讨论】:

    标签: c# .net event-handling telerik radgrid


    【解决方案1】:

    为了让您知道您单击了哪一列,请将 commandname 属性附加到该列并在 ItemCommand 事件中处理它。

    网格列标记:

    <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="View" UniqueName="exportPDF" />
    

    检查 itemcommand 事件中的命令名(代码隐藏): if commandname == "View" { ....在这里做点什么.....}

    查看this链接了解更多信息。

    【讨论】:

      猜你喜欢
      • 2011-01-26
      • 2023-03-19
      • 1970-01-01
      • 1970-01-01
      • 2016-01-22
      • 2021-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多