(论坛答疑点滴)联合主键的情况怎么在DataGrid中利用DataKeys定位记录?

发表于:2007-07-01来源:作者:点击数: 标签:
 

比如表中三个字段
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>

原文转自:http://www.ltesting.net