The format i am using is a label:
Code: Select all
<asp:Label ID="CouponCode" runat="server" Text='<%#((OrderShipment)Container.DataItem).Order.Coupons%>' Font-Size="18px"></asp:Label>
Code: Select all
<asp:Label ID="CouponCode" runat="server" Text='<%#((OrderShipment)Container.DataItem).Order.Coupons%>' Font-Size="18px"></asp:Label>
Code: Select all
private OrderItemCollection GetCoupons(Object dataItem)
{
OrderShipment shipment = (OrderShipment)dataItem;
Order order = shipment.Order;
OrderItemCollection coupons = new OrderItemCollection();
foreach (OrderItem item in order.Items)
{
if (item.OrderItemType == OrderItemType.Coupon)
{
coupons.Add(item);
}
}
coupons.Sort(new OrderItemComparer());
return coupons;
}
Code: Select all
private String GetCoupons(Object dataItem)
{
OrderShipment shipment = (OrderShipment)dataItem;
Order order = shipment.Order;
String coupons = "";
foreach (OrderItem item in order.Items)
{
if (item.OrderItemType == OrderItemType.Coupon)
{
coupons+= (item).Name +"<br />";
}
}
return coupons;
}
Code: Select all
<asp:Label ID="CouponLabel" runat="server" Text="Coupon:" SkinID="fieldheader" Visible='<%# (GetCoupons(Container.DataItem)!="") %>'></asp:Label>
<asp:Label ID="CouponCode" runat="server" Text='<%# GetCoupons(Container.DataItem)%>' Font-Size="18px"></asp:Label>