BUG - Orders.ascx dropdownlist

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
This is a typo, somebody forgot a CTRL+V

    protected void FillDropDowns() {
      this.ddlOrderStatus.Items.Clear();
      ListItem itemOrderStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");
      this.ddlOrderStatus.Items.Add(itemOrderStatus);
      OrderStatusCollection orderStatuses = OrderManager.GetAllOrderStatuses();
      foreach (OrderStatus orderStatus in orderStatuses) {
        ListItem item2 = new ListItem(orderStatus.Name, orderStatus.OrderStatusID.ToString());
        this.ddlOrderStatus.Items.Add(item2);
      }


      this.ddlPaymentStatus.Items.Clear();
      ListItem itemPaymentStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");
      this.ddlPaymentStatus.Items.Add(itemPaymentStatus);
      PaymentStatusCollection paymentStatuses = PaymentStatusManager.GetAllPaymentStatuses();
      foreach (PaymentStatus paymentStatus in paymentStatuses) {
        ListItem item2 = new ListItem(paymentStatus.Name, paymentStatus.PaymentStatusID.ToString());
        this.ddlPaymentStatus.Items.Add(item2);
      }

      this.ddlShippingStatus.Items.Clear();
      ListItem itemShippingStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");
      this.ddlShippingStatus.Items.Add(itemOrderStatus); <----- Offending line
      ShippingStatusCollection shippingStatuses = ShippingStatusManager.GetAllShippingStatuses();
      foreach (ShippingStatus shippingStatus in shippingStatuses) {
        ListItem item2 = new ListItem(shippingStatus.Name, shippingStatus.ShippingStatusID.ToString());
        this.ddlShippingStatus.Items.Add(item2);
      }
    }

Using the same ListItem in more than 1 dropdownlist will give you some troubles if you try to declaritively set a default selection on any of the other dropdowns.

that line should be changed to:

      this.ddlShippingStatus.Items.Add(itemShippingStatus);

I hope this helps someone.


C.
14 years ago
Thanks
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.