Exemplo n.º 1
0
    /// <summary>
    /// 重新更新combobox的内容
    /// </summary>
    /// <param name="family"></param>
    public void refreshDropContent()
    {
        //首先清空combobox内容
        DropDownList1.Items.Clear();

        //根据联动参数获取内容
        DropDownList1.Items.Add(new ListItem("", ""));
        iComponet = ServiceAgent.getInstance().GetObjectByName<IComponent>(WebConstant.CommonObject);
        if (iComponet != null)
        {
            IList<ComponentInfo> ctList = iComponet.GetComponentList(customer);
            if (!(ctList == null) && (ctList.Count > 0))
            {

                foreach (ComponentInfo component in ctList)
                {
                    //DropDownList1.Items.Add(new ListItem(component.friendlyName, component.id));
                    DropDownList1.Items.Add(new ListItem(component.id+" "+component.friendlyName, component.id));

                }
            }
        }
        up.Update();

    }