none
获取GRIDVIEW单元格的值 RRS feed

  • 问题

  • <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                DataKeyNames="序号" DataSourceID="SqlDataSource1" 
                onrowcreated="GridView1_RowCreated" onrowdatabound="GridView1_RowDataBound" 
                                onselectedindexchanged="GridView1_SelectedIndexChanged">
                <Columns>
                    <asp:CommandField ShowEditButton="True" />
                    <asp:BoundField DataField="序号" HeaderText="序号" ReadOnly="True" 
                        SortExpression="序号" />
                    <asp:BoundField DataField="日期" HeaderText="日期" SortExpression="日期" />
                    <asp:BoundField DataField="客户" HeaderText="客户" SortExpression="客户" />
                    <asp:BoundField DataField="模具编号" HeaderText="模具编号" SortExpression="模具编号" />
                    <asp:BoundField DataField="成套" HeaderText="成套" SortExpression="成套" />
                    <asp:BoundField DataField="分开" HeaderText="分开" SortExpression="分开" />
                    <asp:BoundField DataField="毛边" HeaderText="毛边" SortExpression="毛边" />
                    <asp:BoundField DataField="脏污" HeaderText="脏污" SortExpression="脏污" />
                    <asp:BoundField DataField="裁切" HeaderText="裁切" SortExpression="裁切" />
                    <asp:BoundField DataField="数量" HeaderText="数量" SortExpression="数量" />
                    <asp:BoundField DataField="完成包数" HeaderText="完成包数" SortExpression="完成包数" />
                    <asp:BoundField DataField="开始" HeaderText="开始" SortExpression="开始" />
                    <asp:BoundField DataField="结束" HeaderText="结束" SortExpression="结束" />
                    <asp:BoundField DataField="平均时间" HeaderText="平均时间" SortExpression="平均时间" />
                    <asp:BoundField DataField="平均每人" HeaderText="平均每人" SortExpression="平均每人" />
                    <asp:BoundField DataField="金额" HeaderText="金额" SortExpression="金额" />
                    <asp:BoundField DataField="组别" HeaderText="组别" SortExpression="组别" />
                    <asp:TemplateField HeaderText="人数" SortExpression="人数">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("人数") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Bind("人数") %>' 
                                onclick="LinkButton1_Click" CommandName="Select" >LinkButton</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>

    当单击人数那一列LINKBUTTON时,怎样才能获得序号的值
    • 已编辑 彭123 2012年5月22日 2:03
    2012年5月21日 13:09

答案

全部回复