我有一个带有 BoundField 列的 gridview,我想专门为此 BoundField 插入一个新行。这是可以做到的吗?
代码如下:
<asp:GridView ID="grdAgreements" runat="server" AutoGenerateColumns="false" Width="100%"
AllowSorting="false" AlternatingRowStyle-BackColor="White"
HeaderStyle-BackColor="White" HeaderStyle-ForeColor="GrayText"
Font-Names="Arial" Font-Size="11" DataKeyNames="AgreementId" OnRowCreated="grdAgreements_RowCreated" >
<rowstyle height="24" />
<Columns>
<asp:BoundField HeaderText="Agreement Number" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="AgreementNumber" SortExpression="AgreementNumber" ItemStyle-Width="110" ItemStyle-Font-Names="Arial" />
<asp:BoundField HeaderText="Description" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="Description" SortExpression="Description" ItemStyle-Width="100" ItemStyle-Font-Names="Arial" />
<asp:BoundField HeaderText="Start Date" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="StartDate" SortExpression="StartDate" ItemStyle-Width="125" ItemStyle-Font-Names="Arial" />
<asp:BoundField HeaderText="End Date" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="EndDate" SortExpression="EndDate" ItemStyle-Width="200" ItemStyle-Font-Names="Arial" />
<asp:BoundField HeaderText="Site Number" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="SiteNumber" SortExpression="SiteNumber" ItemStyle-Width="200" ItemStyle-Font-Names="Arial" />
</Columns>
<EmptyDataTemplate>
There are no agreements to display.
</EmptyDataTemplate>
</asp:GridView>
我想要发生的是,我希望将 SiteNumber 数据绑定到可以粘贴在 div 或面板中的新行,而不是 BoundField。我该怎么做呢?