Ejemplo n.º 1
0
 public override void BreakLinksToControl(bool unwireEventsOnly)
 {
     if (_searchDropDownEdit != null)
     {
         _searchDropDownEdit.DropDown.SelectedIndexChanged -= dropDownLookup_SelectedIndexChanged;
         _searchDropDownEdit.Init      -= dropDownLookup_Init;
         _searchDropDownEdit.PreRender -= dropDownLookup_PreRender;
         _searchDropDownEdit.Callback  -= result_Callback;
     }
     if (!unwireEventsOnly)
     {
         _searchDropDownEdit = null;
     }
     base.BreakLinksToControl(unwireEventsOnly);
 }
Ejemplo n.º 2
0
        ASPxSearchDropDownEdit CreateSearchDropDownEditControl()
        {
            var result = new ASPxSearchDropDownEdit(_helper, EmptyValue, DisplayFormat)
            {
                Width = Unit.Percentage(100)
            };

            result.DropDown.SelectedIndexChanged += dropDownLookup_SelectedIndexChanged;
            result.Init      += dropDownLookup_Init;
            result.PreRender += dropDownLookup_PreRender;
            result.Callback  += result_Callback;
            result.ReadOnly   = !AllowEdit;
            UpdateDropDownLookup(result);
            return(result);
        }
Ejemplo n.º 3
0
        protected override WebControl CreateEditModeControlCore()
        {
            if (_newObjectWindowAction == null)
            {
                _newObjectWindowAction          = new PopupWindowShowAction(null, "New", PredefinedCategory.Unspecified.ToString());
                _newObjectWindowAction.Execute += newObjectWindowAction_OnExecute;
                _newObjectWindowAction.CustomizePopupWindowParams += newObjectWindowAction_OnCustomizePopupWindowParams;
                _newObjectWindowAction.Application = _helper.Application;
            }

            var panel = new Panel();

            // Use Panel instead of ASPxPanel cause it doesn't affect editor ClientID
            _searchDropDownEdit = CreateSearchDropDownEditControl();
            panel.Controls.Add(_searchDropDownEdit);
            return(panel);
        }
Ejemplo n.º 4
0
 void UpdateDropDownLookupControlAddButton(ASPxSearchDropDownEdit control)
 {
     control.AddingEnabled = false;
     if (CurrentObject != null)
     {
         string diagnosticInfo;
         RecreateListView(true);
         control.AddingEnabled = AllowEdit &&
                                 DataManipulationRight.CanCreate(_listView, _helper.LookupObjectType,
                                                                 _listView.CollectionSource, out diagnosticInfo);
         if (control.AddingEnabled)
         {
             if (_newObjectViewController != null)
             {
                 control.AddingEnabled = _newObjectViewController.NewObjectAction.Active &&
                                         _newObjectViewController.NewObjectAction.Enabled;
             }
         }
     }
 }
Ejemplo n.º 5
0
 public override void BreakLinksToControl(bool unwireEventsOnly) {
     if (searchDropDownEdit != null) {
         searchDropDownEdit.DropDown.SelectedIndexChanged -= dropDownLookup_SelectedIndexChanged;
         searchDropDownEdit.Init -= dropDownLookup_Init;
         searchDropDownEdit.PreRender -= dropDownLookup_PreRender;
         searchDropDownEdit.Callback -= result_Callback;
     }
     if (!unwireEventsOnly) {
         searchDropDownEdit = null;
     }
     base.BreakLinksToControl(unwireEventsOnly);
 }
Ejemplo n.º 6
0
        protected override WebControl CreateEditModeControlCore() {
            if (newObjectWindowAction == null) {
                newObjectWindowAction = new PopupWindowShowAction(null, "New", PredefinedCategory.Unspecified.ToString());
                newObjectWindowAction.Execute += newObjectWindowAction_OnExecute;
                newObjectWindowAction.CustomizePopupWindowParams += newObjectWindowAction_OnCustomizePopupWindowParams;
                newObjectWindowAction.Application = helper.Application;
            }

            var panel = new Panel();
            // Use Panel instead of ASPxPanel cause it doesn't affect editor ClientID            
            searchDropDownEdit = CreateSearchDropDownEditControl();
            panel.Controls.Add(searchDropDownEdit);
            return panel;
        }
Ejemplo n.º 7
0
 ASPxSearchDropDownEdit CreateSearchDropDownEditControl() {
     var result = new ASPxSearchDropDownEdit(helper, EmptyValue, DisplayFormat) { Width = Unit.Percentage(100) };
     result.DropDown.SelectedIndexChanged += dropDownLookup_SelectedIndexChanged;
     result.Init += dropDownLookup_Init;
     result.PreRender += dropDownLookup_PreRender;
     result.Callback += result_Callback;
     result.ReadOnly = !AllowEdit;
     UpdateDropDownLookup(result);
     return result;
 }
Ejemplo n.º 8
0
 void UpdateDropDownLookupControlAddButton(ASPxSearchDropDownEdit control) {
     control.AddingEnabled = false;
     if (CurrentObject != null) {
         string diagnosticInfo;
         RecreateListView(true);
         control.AddingEnabled = AllowEdit &&
                                 DataManipulationRight.CanCreate(listView, helper.LookupObjectType,
                                                                 listView.CollectionSource, out diagnosticInfo);
         if (control.AddingEnabled) {
             if (newObjectViewController != null) {
                 control.AddingEnabled = newObjectViewController.NewObjectAction.Active &&
                                         newObjectViewController.NewObjectAction.Enabled;
             }
         }
     }
 }