GridView的ButtonField事件& Updatepanel问题 [英] GridView's ButtonField Event & Updatepanel Problem

查看:83
本文介绍了GridView的ButtonField事件& Updatepanel问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<asp:UpdatePanel runat="server" ID="pnlGrid" UpdateMode ="conditional">
<ContentTemplate >
 <asp:GridView ID="gdvEntity" runat="server" AutoGenerateColumns="False" 
        onrowcommand="gdvEntity_RowCommand" 
        onselectedindexchanged="gdvEntity_SelectedIndexChanged" 
    OnRowDeleting="gdvEntity_RowDeleting" OnRowEditing="gdvEntity_RowEditing">
<Columns >
<asp:BoundField DataField="ORG_ENTITY_ID" HeaderText="" Visible="false"  />
:
:
<asp:ButtonField ButtonType="Button" CommandName="Edit" Text="Edit" HeaderText="Edit"  />
 
</Columns>
</asp:GridView><telerik:RadTextBox ID="txttest" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>



我希望当我单击GridView的Button(按钮字段)时,应刷新另一个UpdatePanel的内容.

这是我的另一个UpdatePanel



I want that when I click on GridView''s Button(Button Field) contents of another UpdatePanel should be refreshed.

Here is my another UpdatePanel

<asp:UpdatePanel runat="server" ID="pnlEntityData" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Edit" EventName="Click" />
</Triggers>




问题是,我正在使用ButtonField刷新此面板.我没有ControlID& ButtonField的EventName




Problem is that ,I am using ButtonField to refresh this panel.I dont have ControlID & EventName for ButtonField

推荐答案

您可以使用GridView.RowCommand Event处理Command按钮的click事件.在GridView控件中单击按钮时发生此事件.

将Button控件的CommandName属性设置为字符串值,并在GridView的RowCommand事件中使用GridViewCommandEventArgs检查该值.检查以下链接.

GridView..RowCommand事件 [ ^ ]
You can handle the click event of the Command button using GridView.RowCommand Event. This event cccurs when a button is clicked in a GridView control.

Set the CommandName property of the Button control to a string value and check that value with GridViewCommandEventArgs in the RowCommand event of GridView. Check the following link.

GridView..RowCommand Event[^]


这篇关于GridView的ButtonField事件&amp; Updatepanel问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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