【发布时间】:2014-08-13 14:34:57
【问题描述】:
我有以下GridView:
<asp:GridView ID="gvDispMsg" ClientIDMode="Static" ShowHeaderWhenEmpty="false" AlternatingRowStyle-BackColor="#EBE9E9" AutoGenerateColumns="false" EmptyDataText="There is no data to display" runat="server" AllowPaging="false" AllowSorting="true">
<Columns>
<asp:BoundField HeaderText="Delete Message" HeaderStyle-Width="12%" />
<asp:BoundField HeaderText="ID" HeaderStyle-Width="12%" DataField="ID" />
<asp:BoundField HeaderText="Date" HeaderStyle-Width="13%" DataField="Created" />
<asp:BoundField HeaderText="Message" HeaderStyle-Width="45%" DataField="Message" />
<asp:BoundField HeaderText="Active" HeaderStyle-Width="10%" DataField="Active" />
<asp:BoundField HeaderText="Created By" HeaderStyle-Width="20%" DataField="CreatedBy" />
</Columns>
</asp:GridView>
它是从在代码隐藏中执行的 SQL 表中填充的。唯一未填充的列是 Delete Message 列。
如何为Delete Message 列中的每一行添加一个按钮,该按钮采用ID 数据字段的参数?
【问题讨论】:
-
在哪里添加?
-
而不是删除消息