GridView1_SelectedIndexChanged没有触发 [英] GridView1_SelectedIndexChanged not firing
本文介绍了GridView1_SelectedIndexChanged没有触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的项目中,我定义了一个GridView
In my project, I defined a GridView
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
OnRowDataBound="GridView1_OnRowDataBound" Width="100%"
onselectedindexchanged="GridView1_SelectedIndexChanged">
可以理解,GridView1_SelectedIndexChanged()不会触发除非AutoGenerateSelectButton设置为true。但是,单击GridView的一行后,GridView1_OnRowDataBound()也不会触发。怎样才能解决这个问题?在此之前感谢您的审核并提供反馈。
It is understandable that the GridView1_SelectedIndexChanged() will not fire unless AutoGenerateSelectButton is set as true. But the GridView1_OnRowDataBound() also does not fire after I click a row of the GridView. How can this problem be solved? Thanks in advance for your reviewing and providing your feedback.
推荐答案
OnRowDataBound
绑定gridview后调用事件使用某些数据源,而不是在单击Gridview的任何行时。为此OnRowCommand
调用事件。
详情请访问以下链接。
OnRowCommand_MSDN
SelectedIndexChanged_MSND
onRowDataBound_MSDN
如果你想要在没有设置autogenerateSelectButton的情况下调用SelectedIndexChangedEvent比看看以下内容。
WithoutSelectButton
希望它会有所帮助。 :)
OnRowDataBound
event is called after you bind the gridview with some datasource and not when you click on any row of the Gridview. For thisOnRowCommand
Event is called.
For details visit the following Links.
OnRowCommand_MSDN
SelectedIndexChanged_MSND
onRowDataBound_MSDN
and if you want to call SelectedIndexChangedEvent without setting autogenerateSelectButton Than have a look at following.
WithoutSelectButton
Hope it will help. :)
Quote:
autopostback =true
autopostback = "true"
这篇关于GridView1_SelectedIndexChanged没有触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文