如何在datagridview项目上触发click事件? [英] how to fire click event on datagridview items?
本文介绍了如何在datagridview项目上触发click事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想提供我的datagridview项目的链接...所以当我点击一行中的任何项目时,它应该点击event.can任何人发布任何简单的代码。谢谢!
I want to give links to my datagridview items...so when i click on any item in a row it should fire click event.can anyone post any simple code for it.Thank you!
推荐答案
如果您只想挂钩单击一个单元格,那么您将处理 CellClick [ ^ ]方法。但是,如果要将每个项目转换为等效的超链接,则需要修改 CellTemplate [ ^ ]。
If you just want to hook into clicking on a cell, then you would handle the CellClick[^] method. If, however, you want to convert each item into the equivalent of a hyperlink, you would want to modify the CellTemplate[^].
GridView具有某些功能,如列中的TemplateFiels
,BoundFiled
等。所以你可以在这些领域提供你想要的任何控件。
所以我建议你仔细看看这个给定的示例 [ ^ ]。
-KR
GridView has certain functionality likeTemplateFiels
,BoundFiled
etc in Columns. So you can provide whatever controls you want in these fields.
So I'd suggest you to take a deep look at this given example[^].
-KR
这篇关于如何在datagridview项目上触发click事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文