如何将“删除”事件与按钮相关联?

时间:2021-07-06 15:52:14

I know that I can use "Delete" link in gridview but in my case it doesn't fit . I marked my deleting button.

我知道我可以在gridview中使用“删除”链接但在我的情况下它不适合。我标记了删除按钮。

如何将“删除”事件与按钮相关联?

2 个解决方案

#1


0  

You'll need to make a row in the grid selectable and do an onclicke event for the delete button. Make it delete the selected row in the grid and the rowdeleting event will be fired.

您需要在网格中选择一行并为删除按钮执行onclicke事件。使其删除网格中的选定行,并触发rowdeleting事件。

You can't bind the button directly to the rowdeleting event.

您无法将按钮直接绑定到rowdeleting事件。

#2


1  

use command field instead of link button. Or even you can use css which looks like a button.

使用命令字段而不是链接按钮。甚至你可以使用看起来像按钮的css。

#1


0  

You'll need to make a row in the grid selectable and do an onclicke event for the delete button. Make it delete the selected row in the grid and the rowdeleting event will be fired.

您需要在网格中选择一行并为删除按钮执行onclicke事件。使其删除网格中的选定行,并触发rowdeleting事件。

You can't bind the button directly to the rowdeleting event.

您无法将按钮直接绑定到rowdeleting事件。

#2


1  

use command field instead of link button. Or even you can use css which looks like a button.

使用命令字段而不是链接按钮。甚至你可以使用看起来像按钮的css。