前台代码:
<form id="form1" runat="server">
<div>
<asp:DataGrid ID="dgdOrder" runat="server" AutoGenerateColumns="false" Width="960px" ShowFooter="false">
<Columns>
<asp:TemplateColumn HeaderText="订单号" HeaderStyle-Width="100px" ItemStyle-Width="100px">
<ItemTemplate>
<asp:Label ID="lblID" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.POID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="客户订单号" HeaderStyle-Width="200px" ItemStyle-Width="200px">
<ItemTemplate>
<asp:Label ID="lblCustomerPOID" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.CustomerPO") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="订单类型" HeaderStyle-Width="60px" ItemStyle-Width="60px">
<ItemTemplate>
<asp:Label ID="lblPTypes" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.POType") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="经销商名称" HeaderStyle-Width="200px" ItemStyle-Width="200px">
<ItemTemplate>
<asp:Label ID="lblCustomerName" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.CustomerName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="出厂日期" HeaderStyle-Width="150px" ItemStyle-Width="150px">
<ItemTemplate>
<asp:Label ID="lblPostDate" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.PostDate") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="订单日期" HeaderStyle-Width="150px" ItemStyle-Width="150px">
<ItemTemplate>
<asp:Label ID="lblCreateDate" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.CreateDate") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
</div>
</form>
后台代码: