如何在一个下拉列表中绑定2列,在另一列下方绑定一列并充当一列?

时间:2019-05-02 12:56:57

标签: c# asp.net

我希望下拉列表由必须作为单个列的两列组成。 这些列应在另一列之下。

喜欢

wmsno12345

no12345

我尝试将各列连接起来,但是其中一列在另一列之前。

绑定下拉菜单:

    void BindSalesOrder(string locationCode)
        {
            SOBL objSOBL = new SOBL();
            List<SalesHeaderEntity> lstSalesHeaderEntity = objSOBL.GetB2BSOList(locationCode);
            if (lstSalesHeaderEntity != null)
            {
                ddlB2BSaleOrder.DataSource = lstSalesHeaderEntity;
                if (Common.MyCInt(ViewState["DisplayOrderNoOnBatch"]) == 1)
                {
                    ddlB2BSaleOrder.DataTextField = "OrderNo";

                }
            else
            {
                ddlB2BSaleOrder.DataTextField = "No";

                }
            ddlB2BSaleOrder.DataValueField = "No";
                ddlB2BSaleOrder.DataBind();
                ddlB2BSaleOrder.Items.Insert(0, new ListItem("Please Select", "0"));
            }
            else
            {
                ddlB2BSaleOrder.Items.Clear();
                ddlB2BSaleOrder.Items.Insert(0, new ListItem("Please Select", "0"));
            }
        }

下拉

 <td class="col-md-3 form-group">
       <asp:DropDownList ID="ddlB2BSaleOrder" runat="server" CssClass="form-control js-example-placeholder-single" AutoPostBack="true"
                                            OnSelectedIndexChanged="ddlB2BSaleOrder_SelectedIndexChanged" ToolTip="Select ">
            </asp:DropDownList>
            <asp:RequiredFieldValidator SetFocusOnError="true" ID="rfvB2BSaleOrder" CssClass="Asterix"
                                            Visible="false" InitialValue="0" ValidationGroup="Save" runat="server" ControlToValidate="ddlB2BSaleOrder"
                                            ErrorMessage="Please select Sale Order." Display="None">*</asp:RequiredFieldValidator>
      </td>

0 个答案:

没有答案