예제 #1
0
        void CreateButtons(RepositoryItemGridLookUpEditEx properties)
        {
            properties.ButtonsStyle = BorderStyles.HotFlat;
            var editButton = CreatelButton("Action_Edit", "tooltipDetail", "DetailButtonTag");

            editButton.Enabled = _lookup.EditValue != null;


            string info;

            editButton.Visible = DataManipulationRight.CanEdit(MemberInfo.MemberType, null, null, null, null) && DataManipulationRight.CanEdit(ObjectType, propertyName, CurrentObject, null, _helper.ObjectSpace);
            properties.Buttons.Add(editButton);
            var newButton = CreatelButton("MenuBar_New", "tooltipNew", "AddButtonTag");

            newButton.Visible = DataManipulationRight.CanCreate(null, MemberInfo.MemberType, null, out info);
            properties.Buttons.Add(newButton);
            var clearButton = CreatelButton("Action_Clear", "tooltipClear", "MinusButtonTag");

            clearButton.Enabled = editButton.Enabled;
            if (!editButton.Visible)
            {
                properties.ReadOnly = true;
                clearButton.Visible = false;
                newButton.Visible   = false;
            }
            properties.Buttons.Add(clearButton);
            _lookup.EditValueChanged += (sender, args) => {
                editButton.Enabled  = _lookup.EditValue != null && AllowEdit.ResultValue;
                clearButton.Enabled = editButton.Enabled;
            };
        }
        private void UpdateActionState( )
        {
            string diagnosticInfo;

            addFromFileAction.Enabled.SetItemValue("Security", DataManipulationRight.CanCreate(View, View.ObjectTypeInfo.Type, LinkToListViewController.FindCollectionSource(Frame), out diagnosticInfo));
            if (View != null && View.IsRoot)
            {
                addFromFileAction.Enabled.SetItemValue("ObjectSpaceNotModified", !ObjectSpace.IsModified);
            }
            else
            {
                addFromFileAction.Enabled.RemoveItem("ObjectSpaceNotModified");
            }
        }
 private 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;
             }
         }
     }
 }