我们如何从gridview的命令字段中删除更新模式 [英] how we can remove update mode from a command field in gridview
本文介绍了我们如何从gridview的命令字段中删除更新模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有命令域的gridview,就像这样.当我单击编辑按钮时,它将更改为更新.实际上,我不想在调用row_editing事件时进行更改以进行更新.请帮帮我.
I have a gridview with commandfield like this. when I click the edit button, it will change to update. actually I don''t want to change to update when it calls the row_editing event. please help me.
<asp:UpdatePanel runat="server" id="updatePanelGrid" UpdateMode="Conditional">
<ContentTemplate>
<fieldset>
<table border="0" cellpadding="2" cellspacing="2" width="100%">
<tr>
<td align="center">
<asp:GridView ID="grdCustomer" AllowPaging="True" runat="server"
AutoGenerateColumns="False" Width="100%" >
<Columns>
<asp:CommandField ShowEditButton="True" ShowCancelButton="false" ControlStyle-CssClass="gridbutton"/>
<asp:TemplateField></asp:TemplateField>
<asp:BoundField DataField="PartyId" HeaderText="Party Id" ReadOnly="true" />
<asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="true"/>
<asp:BoundField DataField="phone" HeaderText="PHONE" ReadOnly="true"/>
<asp:BoundField DataField="Address" HeaderText="Address" ReadOnly="true" />
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</fieldset>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btSave" />
</Triggers>
</asp:UpdatePanel>
代码包装在"Pre"标记中[/编辑]
Code is wrapped in "Pre" tag[/Edited]
推荐答案
使用TemplateColumn提供所需的功能
Use a TemplateColumn to provide the functionality you wish
这篇关于我们如何从gridview的命令字段中删除更新模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文