简体   繁体   English

单列新行上的“删除和编辑”按钮

[英]Delete and Edit button on new line in a single column

I am trying to add edit, delete button on my gridview using, 我正在尝试使用以下方法在我的网格视图上添加编辑,删除按钮:

<asp:CommandField HeaderText="Edit/Delete" ShowEditButton="true" ShowDeleteButton="True" />

however it looks like this now, 但是现在看起来像这样

在此处输入图片说明

I want Delete button on a new row, what can I do ? 我要在新行上删除按钮,该怎么办?

like this 像这样

Edit 编辑
Delete 删除

Try first convert commandbuttons to template then adding <br /> between edit button and delete button 尝试先将命令按钮转换为模板,然后在编辑按钮和删除按钮之间添加<br />

UPDATE In Gridview Task then Select the commands that you want to convert to TemplateField in "Selected Fields:" then check your source code. UPDATE在Gridview Task中,然后在“ Selected Fields:”中选择要转换为TemplateField的命令,然后检查源代码。 You will see in the ItemTemplate 您将在ItemTemplate中看到

  <asp:ItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit"></asp:LinkButton> <br /> <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete"></asp:LinkButton> </ItemTemplate> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM