网格视图中标题模板中按钮的事件 [英] Event of button in Header template in Grid view
本文介绍了网格视图中标题模板中按钮的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Gridview并将按钮放置在标题模板中.
但是我无法获得它的点击事件.任何人都可以调查并指导我吗?我的代码是:
I am using a Gridview and placing a button inside the header template.
But i am unable to get it''s click event. Can anyone look into it and guide me? My code is:
<asp:gridview id="gvReviewRequest" allowpaging="True" onrowcommand="ProductsGridView_RowCommand" xmlns:asp="#unknown">
AutoGenerateColumns="False" runat="server">
<columns>
<asp:templatefield headertext="Price">
<itemtemplate>
<asp:label id="lblStatus" runat="server" text="<%# Eval("Status") %>"></asp:label>
</itemtemplate>
</asp:templatefield>
<asp:templatefield>
<headertemplate>
<asp:button runat="server" id="IncreaseButton" text="Increase Price 5%" commandname="Increase">
/>
</asp:button></headertemplate>
<itemtemplate>
</itemtemplate>
</asp:templatefield>
</columns>
</asp:gridview>
推荐答案
通过下面的链接进行gridview,在页脚中有一个按钮.....
链接对我有用.
www.aspsnippets.com/Articles/Adding- Dynamic-Rows-in-ASP.Net-GridView-Control-with-TextBoxes.aspx [
Go through the below link for gridview having a button in the footer.....
the link is working for me.
www.aspsnippets.com/Articles/Adding-Dynamic-Rows-in-ASP.Net-GridView-Control-with-TextBoxes.aspx[^]
Just type in the google Adding Dynamic Rows in ASP.Net GridView Control with TextBoxes aspsnippets.com
,您也可以直接为按钮提供点击事件,
You can also directly give click event for button,
<asp:button runat="server" id="IncreaseButton" text="Increase Price 5%" OnClick="btn_Click"
你能这样尝试吗
Can you try this way
这篇关于网格视图中标题模板中按钮的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文