  <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" CssClass="SellHistory" EnableViewState="false"  DataSourceID="ObjectDataSource2" GridLines="None" OnDataBound="GridView1_DataBound">
                    <Columns>        
                        <asp:TemplateField HeaderText="买家">
                            <ItemTemplate>
                              <asp:HyperLink ID="buyer" runat="server" Text='<%# Eval("buyername") %>' NavigateUrl='<%#"../Shop1/Shop_review.aspx?UserID="+ Eval("UserID") %>' />
                              
                            </ItemTemplate>
                            <HeaderStyle Width="35%" />
                          
                        </asp:TemplateField>                        
                        <asp:BoundField DataField="MoneyGoods" HeaderText="出价" />
                        <asp:BoundField DataField="Quantity" HeaderText="购买数量" >
                            <HeaderStyle Width="15%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="UpdateTime" DataFormatString="{0:yyyy年M月dd日HH时mm分s秒 }" HtmlEncode="False" HeaderText="时间" >
                            <HeaderStyle Width="30%" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="状态">
                            <ItemTemplate>
                                <asp:literal runat="server" id="status" Text='<%# Eval("Status") %>' />
                                <asp:Image runat="server" id="status_show" />
                                 <asp:HiddenField ID="payStatus" runat="server" Value='<%# Eval("PayStatus") %>' />
                            </ItemTemplate>
                            <HeaderStyle Width="10%" />
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate><div style="text-align:center; height:20px; font-size:14px;">暂时没有买家购买此商品！</div></EmptyDataTemplate>
                    
                </asp:GridView>   

 <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetProductSaleOrderByProductID"
        TypeName="Shop_Order" OldValuesParameterFormatString="original_{0}">
        <SelectParameters>
            <asp:ControlParameter ControlID="h_product_id" DefaultValue="0" Name="ProductID"
                PropertyName="Value" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>

 protected void GridView1_DataBound(object sender, EventArgs e)
    {
        foreach (GridViewRow row in GridView1.Rows)
        {
            if (row.RowType == DataControlRowType.DataRow)
            {
                Literal m_status = (Literal)row.FindControl("status");
                Image m_pic = (Image)row.FindControl("status_show");
                if (m_status.Text == "领先" || m_status.Text == "成交" || m_status.Text == "交易成功")
                {
                    m_pic.ImageUrl = "../Images/okhand.gif";
                }
                else
                {
                    m_pic.Visible = false;
                }
                if (row.RowIndex == 0 && m_status.Text == "领先")
                {
                    m_pic.ImageUrl = "../Images/okhand.gif";
                }
                else
                {
                    m_pic.Visible = false;
                }
                if (product_type.Text == "团购" && m_status.Text=="团购中")
                {
                    HiddenField hd =(HiddenField)row.FindControl("payStatus");                  
                }
            }
        }
      
    }   