比如表中三个字段
key1 int,key2 int,item varchar(50)
前面2个字段联合主键
前台代码:
<asp:DataGrid id="DataGrid1" runat="server" AutoGenerateColumns="False" DataKeyField="DoubleKey">
<Columns>
<asp:BoundColumn DataField="item" HeaderText="item"></asp:BoundColumn>
<asp:ButtonColumn CommandName="del" Text="删除"></asp:ButtonColumn>
</Columns>
</asp:DataGrid>
<Columns>
<asp:BoundColumn DataField="item" HeaderText="item"></asp:BoundColumn>
<asp:ButtonColumn CommandName="del" Text="删除"></asp:ButtonColumn>
</Columns>
</asp:DataGrid>
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/
领测软件测试网最新更新