zoukankan      html  css  js  c++  java
  • GridView帮定数据显示数据的技巧

    <asp:GridView ID="grdList" runat="server" AutoGenerateColumns="False" Width="100%"
            DataKeyNames="SalesOrderId" OnRowDataBound="grdList_RowDataBound" AllowPaging="True" PageSize="50" OnPageIndexChanging="grdList_PageIndexChanging">
            <Columns>
             <asp:HyperLinkField Target="_blank" DataTextField="SalesNum" HeaderText="订单编号">
              <HeaderStyle Width="60px" />
             </asp:HyperLinkField>
             <asp:BoundField HeaderText="订单状态" DataField="StateName">
              <HeaderStyle Width="60px" />
             </asp:BoundField>
             <asp:BoundField HeaderText="客户编号" DataField="CustomerNum">
              <HeaderStyle Width="60px" />
             </asp:BoundField>
             <asp:BoundField HeaderText="姓名" DataField="Consignee">
              <HeaderStyle Width="60px" />
             </asp:BoundField>
             <asp:TemplateField HeaderText="电话">
              <ItemTemplate>
               <asp:LinkButton ID="lkTel" runat="server" Text="******"></asp:LinkButton>
              </ItemTemplate>
                                            <ControlStyle Width="60px" />
             </asp:TemplateField>
             <asp:TemplateField HeaderText="手机">
              <ItemTemplate>
               <asp:LinkButton ID="lkMob" runat="server" Text='******'></asp:LinkButton>
              </ItemTemplate>
                                            <ControlStyle Width="60px" />
             </asp:TemplateField>
             <asp:BoundField HeaderText="送货地址" DataField="Address">
                                            <ControlStyle Width="50%" />
                                            <ItemStyle CssClass="gvAddress" />
             </asp:BoundField>
             <asp:BoundField HeaderText="总金额" DataField="Amount" DataFormatString="{0:N2}">
              
                                            <ItemStyle CssClass="gvAmount" />
             </asp:BoundField>
             <asp:BoundField HeaderText="受理人" DataField="AcceptName">
              <HeaderStyle Width="45px" />
             </asp:BoundField>
             <asp:BoundField HeaderText="订购日期" DataField="SalesDate" DataFormatString="{0:yyyy-MM-dd}">
              <HeaderStyle Width="80px" />
             </asp:BoundField>
             <asp:TemplateField HeaderText="操作">
              <ItemTemplate>
               <asp:HyperLink ID="HyperLink1" NavigateUrl='<%#"SalesEdit.aspx?id=" + Eval("SalesOrderId") %>'
                Target="_blank" runat="server">编辑</asp:HyperLink>
              </ItemTemplate>
                                            <ControlStyle Width="30px" />
             </asp:TemplateField>
            </Columns>
            <RowStyle CssClass="gvRow" BackColor="White" />
            <HeaderStyle CssClass="gvHeader" />
            <AlternatingRowStyle CssClass="gvAlternatingRow" BackColor="#F4F4F4" />
            
                                    <PagerSettings PageButtonCount="30" />
           </asp:GridView>

  • 相关阅读:
    1091 Acute Stroke
    1092 To Buy or Not to Buy
    1093 Count PAT's
    1094 The Largest Generation
    1095 Cars on Campus
    1096 Consecutive Factors
    1097 Deduplication on a Linked List
    2.掌握Python基本数据类型,从python陌路人到熟人!
    Python基础语法,他其实很贵!
    某外企软件测试面试题整理(更新中)
  • 原文地址:https://www.cnblogs.com/hellohongfu/p/1837426.html
Copyright © 2011-2022 走看看