我已经放置了GridView Ctrl ..但是GridView1_SelectedIndexChanged事件没有触发....有人可以帮助我吗..预先感谢s. [英] I have placed GridView Ctrl .. But GridView1_SelectedIndexChanged event is not triggering.... Can anybody help me .. Thank s in advance.

查看:113
本文介绍了我已经放置了GridView Ctrl ..但是GridView1_SelectedIndexChanged事件没有触发....有人可以帮助我吗..预先感谢s.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将GridView Ctrl和html< img>在其中..现在我想在另一个图像控件中显示从gridview中选择的图像,但是在网格中单击图像时不会触发GridView1_SelectedIndexChanged事件..有人可以帮助我..在此先感谢s.

< asp:gridview id = " autogenerateselectbutton = " >




第二种方法是使用自定义的LinkBut​​ton,Button,ImageButton. 我只能猜测这就是您要尝试做的.由于您没有提供任何代码,我无法确定!
如果您尝试以这种方式进行操作,则必须考虑在这种情况下,不会引发SelectedRowEvent.发生的情况是单击按钮后,将引发一个RowCommand,该命令可用于将特定行设置为SelectionMode,从而引发SelectedRowEvent.

如果您真的对其他帮助感兴趣,请改善您的问题.

另请参阅类似问题的帖子:
gridview中的行命令. [ 解决方案

The SelectedIndexChanged event is triggered when the a row of the GridView is selected.
Now first of all you''ll have to configure the GridView to allow for Selection of rows.

The simples way to do this is to auto generate the select column by adding the attribute as follows

<asp:gridview id="CustomersGridView"
      autogenerateselectbutton="True">




The second way is to use a customized LinkButton, Button, ImageButton. I could only guess that''s what you''re trying to do. Since you didn''t provide any code i can not tell for sure!
If you''re trying to do it this way you''ll have to consider that in this case the SelectedRowEvent isn''t raised. What is happening is after the Button was clicked a RowCommand is raised which can be used to set the specific row into SelectionMode thereby raising the SelectedRowEvent.

Improve your question if you''re really interested in additional help.

See also this post with a similar question:
Row Command in gridview.[^]


Please try with image button control to show images instead of image control..


这篇关于我已经放置了GridView Ctrl ..但是GridView1_SelectedIndexChanged事件没有触发....有人可以帮助我吗..预先感谢s.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆