예제 #1
0
        public void InitializeWithField(Microsoft.SharePoint.SPField field)
        {
            parentField = field as CascadeDropdownFieldType;

            if (parentField != null)
            {
                CascadeType         = parentField.CascadeType;
                CascadeList         = parentField.CascadeList;
                CascadeParent       = parentField.CascadeParent;
                CascadeDisplayName  = parentField.CascadeDisplayField;
                CascadeCompareField = parentField.CascadeCompareField;
            }

            rblCascadeType.SelectedIndexChanged += rblCascadeType_SelectedIndexChanged;
            ddlParentList.SelectedIndexChanged  += ddlParentList_SelectedIndexChanged;
            ddlChildList.SelectedIndexChanged   += ddlChildList_SelectedIndexChanged;
            ddlChildLookup.SelectedIndexChanged += ddlChildLookup_SelectedIndexChanged;

            if (!Page.IsPostBack)
            {
                if (string.IsNullOrEmpty(CascadeType))
                {
                    rblCascadeType.SelectedIndex = 0;
                }
                else if (CascadeType == "Child")
                {
                    rblCascadeType.SelectedIndex = 1;
                }

                rblCascadeType_SelectedIndexChanged(null, EventArgs.Empty);
            }
        }
예제 #2
0
        public void OnSaveChange(Microsoft.SharePoint.SPField field, bool isNewField)
        {
            CascadeDropdownFieldType customFieldType = field as CascadeDropdownFieldType;

            if (customFieldType != null)
            {
                customFieldType.IsNew = isNewField;
                if (rblCascadeType.SelectedIndex == 0) //Parent ROOT cascade list choice
                {
                    customFieldType.CascadeList         = ddlParentList.SelectedValue;
                    customFieldType.CascadeDisplayField = ddlParentListDisplayName.SelectedValue;
                    customFieldType.CascadeType         = "Parent";
                }
                else if (rblCascadeType.SelectedIndex == 1)
                {
                    customFieldType.CascadeType         = "Child";
                    customFieldType.CascadeParent       = ddlChildList.SelectedValue;
                    customFieldType.CascadeList         = ddlChildLookup.SelectedValue;
                    customFieldType.CascadeDisplayField = ddlChildLookupDisplayName.SelectedValue;

                    customFieldType.CascadeCompareField = GetCascadeParentCompareField();
                }
            }
        }
 public CascadeDropdownFieldControl(CascadeDropdownFieldType parent)
 {
     this.parentField = parent;
 }