我正在尝试将一行的数字添加到gridview之外的标签中。我该怎么做?
这是我的gridview代码:
<asp:GridView ID="GridView1" runat="server" Width="539px" BackColor="White" BorderColor="#DEDFDE" BorderStyle="Double" OnRowDeleting="OnRowDeleting" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" Font-Size="Small" >
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="Action" HeaderStyle-HorizontalAlign="Center" ShowHeader="False">
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" CommandName="Delete" Height="22px" ImageUrl="~/images/dialog-close.png" onclientclick=" return confirm('Are you want to Delete this Item?');" Text="Delete" Width="22px" />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#CCCC99" />
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
<RowStyle BackColor="#F7F7DE" />
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FBFBF2" />
<SortedAscendingHeaderStyle BackColor="#848384" />
<SortedDescendingCellStyle BackColor="#EAEAD3" />
<SortedDescendingHeaderStyle BackColor="#575357" />
</asp:GridView>
以下是Gridview Rows:
dr["PartNumber"] = dtparts.Rows[i]["PartNumber"];
dr["Qty"] = qty;
dr["Price"] = priceff;
dr["ExtPrice"] = "$" + Convert.ToDouble(qty) * Convert.ToDouble(pricedb);
dttemp.Rows.Add(dr);