编程语言

img bgu

[ASP.net]DataGrid自定义模版前端代码

发表于2004/10/14 16:09:00  1197人阅读

<asp:datagrid id="dgList" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server" CellPadding="0" GridLines="None" Width="100%" PageSize="2" AllowPaging="True" AutoGenerateColumns="False" ShowFooter="True">
     <AlternatingItemStyle BackColor="#777777"></AlternatingItemStyle>
     <Columns>
      <asp:TemplateColumn>
       <HeaderStyle Font-Size="X-Small" HorizontalAlign="Center" ForeColor="Blue" BackColor="#FFCC66"></HeaderStyle>
       <ItemStyle Font-Size="X-Small" HorizontalAlign="Center"></ItemStyle>
       <HeaderTemplate>
        <div>
         <table width="100%" bgcolor="#cc9966">
          <tr>
           <td><span>HeaderFonts</span></td>
          </tr>
         </table>
        </div>
       </HeaderTemplate>
       <ItemTemplate>
        <div>
         <table width="100%">
          <tr>
           <td>
            <%#DataBinder.Eval(Container.DataItem,"ID")%>
           </td>
           <td>
            <%#DataBinder.Eval(Container.DataItem,"Caption")%>
           </td>
          </tr>
          <tr>
           <td>
            <%#DataBinder.Eval(Container.DataItem,"content")%>
           </td>
          </tr>
         </table>
        </div>
       </ItemTemplate>
       <FooterTemplate>
        <div>
         <table width="100%" bgcolor="#cc6666">
          <tr>
           <td><span>FooterFonts</span></td>
          </tr>
         </table>
        </div>
       </FooterTemplate>
      </asp:TemplateColumn>
     </Columns>
     <PagerStyle NextPageText="&lt;B&gt;下一頁&lt;/B&gt;" PrevPageText="&lt;B&gt;上一頁&lt;/B&gt;" HorizontalAlign="Center" BackColor="Olive"></PagerStyle>
    </asp:datagrid>
阅读全文
0 0

相关文章推荐

img
取 消
img