コード例 #1
0
        protected override WebControl CreateEditModeControlCore()
        {
            this._spreadsheet = new ASPxSpreadsheet();

            _spreadsheet.SettingsDocumentSelector.UploadSettings.Enabled = true;
            _spreadsheet.SettingsDocumentSelector.UploadSettings.UseAdvancedUploadMode = true;
            _spreadsheet.SettingsDocumentSelector.UploadSettings.AdvancedModeSettings.EnableFileList    = true;
            _spreadsheet.SettingsDocumentSelector.UploadSettings.AdvancedModeSettings.EnableMultiSelect = true;
            _spreadsheet.SettingsDocumentSelector.UploadSettings.AutoStartUpload = true;

            //初始目录:当前登陆用户+当天日期
            var dir = "~/ExcelFiles/" + SecuritySystem.CurrentUserName + "/" + DateTime.Now.ToString("yyyyMMdd");

            _spreadsheet.WorkDirectory = dir;

            _spreadsheet.ShowConfirmOnLosingChanges = false;
            _spreadsheet.ClientSideEvents.Init      = "function(s, e){ s.SetFullscreenMode(true); }";
            _spreadsheet.Height = 800;
            _spreadsheet.CreateDefaultRibbonTabs(true);
            _spreadsheet.ActiveTabIndex = 0;//默认标签行这个可以打开的时候默认第一个导入的标签

            //_spreadsheet.ClientSideEvents.CustomCommandExecuted
            if (IsNewStyle)
            {
                _spreadsheet.ClientSideEvents.Init = "function(s, e){ s.SetFullscreenMode(false); }";
                _spreadsheet.Theme = "Aqua";
            }

            _spreadsheet.Load += (s, e) =>
            {
                var handlerid = _spreadsheet.UniqueID + "StartImport";

                var page = _spreadsheet.Page as ICallbackManagerHolder;

                page.CallbackManager.RegisterHandler(handlerid, this);


                var doAction = page.CallbackManager.GetScript(handlerid, "null");
                _spreadsheet.ClientSideEvents.CustomCommandExecuted = "function(s,e) { " + doAction + " }";
            };

            var t = _spreadsheet.RibbonTabs[0];
            var g = t.Groups.Add("导入");
            //_spreadsheet.Document
            var temp = new RibbonButtonItem("ImportData", "导入数据", RibbonItemSize.Large);

            temp.LargeImage.Url = "~/Images/ImportData_32x32.png";

            //new RibbonTemplateItem();
            g.Items.Add(temp);
            //StartImport = new StartImportTemplate(_spreadsheet, this._objectSpace, this._application);
            //temp.Template = StartImport;

            importer.InitializeExcelSheet(_spreadsheet.Document, this.option);

            //_spreadsheet.d
            return(_spreadsheet);
        }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        RichEdit.CreateDefaultRibbonTabs(true);
        RichEdit.RibbonTabs[0].Groups[0].Items.Clear();

        for (int i = 1; i < RichEdit.RibbonTabs.Count; i++)
        {
            RichEdit.RibbonTabs[i].Visible = false;
        }

        var saveItem = new RibbonButtonItem("Save");

        saveItem.LargeImage.IconID = IconID.SaveSave32x32;
        saveItem.Size = RibbonItemSize.Large;
        RichEdit.RibbonTabs[0].Groups[0].Items.Add(saveItem);
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ASPxRichEdit1.CreateDefaultRibbonTabs(true);
        ASPxRichEdit1.RibbonTabs[0].Groups[0].Items.RemoveAt(1);
        var openItem = new RibbonButtonItem("Open");

        openItem.LargeImage.IconID = IconID.ActionsOpen32x32;
        openItem.Size = RibbonItemSize.Large;
        ASPxRichEdit1.RibbonTabs[0].Groups[0].Items.Add(openItem);

        if (!IsPostBack)
        {
            FileManagerFile file = FileManager.SelectedFolder.GetFiles().FirstOrDefault();
            if (file != null)
            {
                FileManager.SelectedFile = file;
                ASPxRichEdit1.Open(Server.MapPath(file.FullName));
            }
        }
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ASPxRichEdit1.Open(Server.MapPath("CharacterFormatting.rtf"));
        }

        ASPxRichEdit1.CreateDefaultRibbonTabs(true);

        var copyItem = new RibbonButtonItem("Copy format");

        copyItem.LargeImage.IconID = "edit_copy_32x32office2013";
        copyItem.Size = RibbonItemSize.Large;
        ASPxRichEdit1.RibbonTabs[1].Groups[1].Items.Add(copyItem);

        var pasteItem = new RibbonButtonItem("Paste format");

        pasteItem.LargeImage.IconID = "edit_paste_32x32office2013";
        pasteItem.Size = RibbonItemSize.Large;
        ASPxRichEdit1.RibbonTabs[1].Groups[1].Items.Add(pasteItem);
    }
コード例 #5
0
        private void InitializeEditTools()
        {
            _items = new List <CreatedRibbonItem>();

            foreach (var editToolProvider in _mefEditToolProviders.OrderBy(p => p.Metadata.Order))
            {
                if (editToolProvider.Metadata == null)
                {
                    continue;
                }

                var createCommand = new DelegateCommand(
                    () => CanvasService.CanvasDataContext.CurrentEditTool = editToolProvider.Value.CreateEditTool(),
                    () => editToolProvider.Value.CanCreate
                    );

                editToolProvider.Value.CanCreateChanged += (sender, e) => {
                    createCommand.RaiseCanExecuteChanged();
                };

                var ribbonBtnItem = new RibbonButtonItem {
                    Command           = createCommand,
                    Icon              = editToolProvider.Metadata.IconResource,
                    GUID              = editToolProvider.Metadata.GUID,
                    GroupGUID         = editToolProvider.Metadata.GroupGUID,
                    HeaderLanguageKey = editToolProvider.Metadata.EditToolLanguageKey,
                    Order             = editToolProvider.Metadata.Order
                };

                var createdRibbonItem = new CreatedRibbonItem(
                    ribbonBtnItem,
                    new ExportRibbonItemAttribute {
                    GUID      = editToolProvider.Metadata.GUID,
                    GroupGUID = editToolProvider.Metadata.GroupGUID
                }
                    );

                _items.Add(createdRibbonItem);
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        RichEdit.CreateDefaultRibbonTabs(true);

        for (int i = 1; i < RichEdit.RibbonTabs.Count; i++)
        {
            RichEdit.RibbonTabs[i].Visible = false;
        }

        RichEdit.RibbonTabs[0].Groups[0].Items.RemoveAt(0);
        var newItem = new RibbonButtonItem("New");

        newItem.LargeImage.IconID = IconID.ActionsNew32x32;
        newItem.Size = RibbonItemSize.Large;
        RichEdit.RibbonTabs[0].Groups[0].Items.Add(newItem);

        RichEdit.RibbonTabs[0].Groups[0].Items.RemoveAt(0);
        var openItem = new RibbonButtonItem("Open");

        openItem.LargeImage.IconID = IconID.ActionsOpen32x32;
        openItem.Size = RibbonItemSize.Large;
        RichEdit.RibbonTabs[0].Groups[0].Items.Add(openItem);

        RichEdit.RibbonTabs[0].Groups[0].Items.RemoveAt(0);
        var saveItem = new RibbonButtonItem("Save");

        saveItem.LargeImage.IconID = IconID.SaveSave32x32;
        saveItem.Size = RibbonItemSize.Large;
        RichEdit.RibbonTabs[0].Groups[0].Items.Add(saveItem);

        RichEdit.RibbonTabs[0].Groups[0].Items.RemoveAt(0);
        var saveAsItem = new RibbonButtonItem("SaveAs");

        saveAsItem.LargeImage.IconID = IconID.SaveSaveas32x32;
        saveAsItem.Size = RibbonItemSize.Large;
        RichEdit.RibbonTabs[0].Groups[0].Items.Add(saveAsItem);
    }
コード例 #7
0
        protected void SetupRibbon()
        {
            ASPxRibbon ribbon = new ASPxRibbon();
            RibbonTab tab = new RibbonTab();

            RibbonGroup editingGroup = new RibbonGroup();
            editingGroup.Name = "Editing";
            editingGroup.Text = "Editing";

            RibbonButtonItem saveItem = new RibbonButtonItem
            {
                Name = "Save",
                Text = "Save",
                Size = RibbonItemSize.Large,
                ToolTip = "Save (NB: This will require emails to be re-sent)"
            };
            saveItem.LargeImage.IconID = IconImage.Save_Large;
            editingGroup.Items.Add(saveItem);

            if (importTaskConfiguration != null)
            {
                if (importTaskConfiguration.Oid != Guid.Empty)
                {
                    RibbonButtonItem deleteItem = new RibbonButtonItem
                    {
                        Name = "Delete",
                        Text = "Delete",
                        Size = RibbonItemSize.Large
                    };
                    deleteItem.LargeImage.IconID = IconImage.Delete_Large;
                    editingGroup.Items.Add(deleteItem);

                    RibbonButtonItem newItem = new RibbonButtonItem
                    {
                        Name = "New",
                        Text = "New",
                        Size = RibbonItemSize.Small,
                        NavigateUrl = UrlManager.ImportTaskConfigurationSaveWithOid(Guid.Empty),

                    };
                    newItem.SmallImage.IconID = IconImage.New_Small;
                    editingGroup.Items.Add(newItem);
                }
            }

            tab.Groups.Add(editingGroup);
            ribbon.Tabs.Add(tab);
            ribbon.ShowTabs = false;

            ShowRibbon(ribbon);
        }
コード例 #8
0
        protected void SetupRibbon()
        {
            ASPxRibbon ribbon = new ASPxRibbon();
            RibbonTab tab = new RibbonTab();

            RibbonGroup editingGroup = new RibbonGroup();
            editingGroup.Name = "Editing";
            editingGroup.Text = "Editing";

            if (importTask.Oid == Guid.Empty)
            {
                editingGroup.Items.Add(RibbonButtonItem("Save", "Start campaign", RibbonItemSize.Large, IconImage.Save_Large));
            }
            else
            {
                editingGroup.Items.Add(RibbonButtonItem("Save", "Save and restart campaign", RibbonItemSize.Large, IconImage.Restart_Large, null, "This will require emails to be re-sent"));
            }

            if (importTask.Oid != Guid.Empty)
            {
                if (importTask.ImportTaskConfiguration != null)
                {
                    RibbonButtonItem configureItem = new RibbonButtonItem
                    {
                        Name = "Overview",
                        Text = "Overview",
                        Size = RibbonItemSize.Large,
                        NavigateUrl = UrlManager.PhonebooksImportTaskOverviewWithOid(importTask.Oid)
                    };
                    configureItem.LargeImage.IconID = IconImage.Search_Large;
                    editingGroup.Items.Add(configureItem);
                }
            }

            if (importTask.Oid != Guid.Empty)
            {
                editingGroup.Items.Add(RibbonButtonItem("Cancel", "Stop campaign", RibbonItemSize.Large, IconImage.Delete_Large));
            }

            tab.Groups.Add(editingGroup);
            ribbon.Tabs.Add(tab);
            ribbon.ShowTabs = false;

            ShowRibbon(ribbon);
        }
コード例 #9
0
        protected void SetupRibbon()
        {
            ASPxRibbon ribbon = new ASPxRibbon();
            RibbonTab tab = new RibbonTab();

            RibbonGroup editingGroup = new RibbonGroup();
            editingGroup.Name = "Editing";
            editingGroup.Text = "Editing";

            RibbonButtonItem commitItem = new RibbonButtonItem
            {
                Name = "TranslateEmployeeData",
                Text = "Auto-correct data",
                Size = RibbonItemSize.Large,
                ToolTip = HelpText.TranslationDescription
            };
            commitItem.LargeImage.IconID = IconImage.Save_Large;
            editingGroup.Items.Add(commitItem);

            RibbonButtonItem dontCommitItem = new RibbonButtonItem
            {
                Name = "TranslateEmployeeDataWithoutCommiting",
                Text = "See what will change",
                Size = RibbonItemSize.Large,
                ToolTip = "This will not save any changes to the employees"
            };
            dontCommitItem.LargeImage.IconID = IconImage.Search_Large;
            editingGroup.Items.Add(dontCommitItem);

            editingGroup.Items.Add(RibbonButtonItem("Edit", RibbonItemSize.Large, IconImage.Edit_Large));

            tab.Groups.Add(editingGroup);
            ribbon.Tabs.Add(tab);
            ribbon.ShowTabs = false;

            ShowRibbon(ribbon);
        }
コード例 #10
0
        protected void SetupRibbon()
        {
            ASPxRibbon ribbon = new ASPxRibbon();
            RibbonTab tab = new RibbonTab();

            RibbonGroup editingGroup = new RibbonGroup();
            editingGroup.Name = "Editing";
            editingGroup.Text = "Editing";

            RibbonButtonItem saveItem = new RibbonButtonItem
            {
                Name = "Save",
                Text = "Save",
                Size = RibbonItemSize.Large
            };
            saveItem.LargeImage.IconID = IconImage.Save_Large;
            editingGroup.Items.Add(saveItem);

            if (SessionData().fieldLegalValueConfiguration.Oid != Guid.Empty)
            {
                editingGroup.Items.Add(RibbonButtonItem("Delete", RibbonItemSize.Large, IconImage.Delete_Large));

                RibbonButtonItem newItem = new RibbonButtonItem
                {
                    Name = "New",
                    Text = "New",
                    Size = RibbonItemSize.Small,
                    NavigateUrl = UrlManager.FieldLegalValueConfigurationSaveWithOid(Guid.Empty, phonebook.Oid)
                };
                newItem.SmallImage.IconID = IconImage.New_Small;
                editingGroup.Items.Add(newItem);
            }

            if (IsPostBack == true)
            {
                editingGroup.Items.Add(RibbonButtonItem("Reset", "Reset", RibbonItemSize.Small, IconImage.Refresh_Small, Request.RawUrl));
            }

            tab.Groups.Add(editingGroup);

            RibbonGroup actionGroup = new RibbonGroup();
            actionGroup.Text = "Action";
            RibbonButtonItem autoCorrectItem = RibbonButtonItem("Translate", "Autocorrect data", RibbonItemSize.Large, IconImage.Convert_Large, UrlManager.PhonebooksTranslateDataWithPhonebook(phonebook.Oid, SessionData().fieldLegalValueConfiguration.Oid), HelpText.TranslationDescription);
            bool enabled = SessionData().fieldLegalValueConfiguration.Oid != Guid.Empty && (IsPostBack == false || didJustSave == true);
            autoCorrectItem.ClientEnabled = enabled;
            autoCorrectItem.ToolTip = enabled ? "Click here to go to the auto-corrections page" : "Save or reset to begin auto correcting your data";
            actionGroup.Items.Add(autoCorrectItem);
            tab.Groups.Add(actionGroup);

            ribbon.Tabs.Add(tab);
            ribbon.ShowTabs = false;

            ShowRibbon(ribbon);
        }
コード例 #11
0
        protected void SetupRibbon()
        {
            ASPxRibbon ribbon = new ASPxRibbon();
            RibbonTab tab = new RibbonTab();

            RibbonGroup group = new RibbonGroup();
            group.Name = "Editing";
            group.Text = "Editing";

            RibbonButtonItem saveItem = new RibbonButtonItem
            {
                Name = "Save",
                Text = "Save",
                Size = RibbonItemSize.Large
            };
            saveItem.LargeImage.IconID = IconImage.Save_Large;
            group.Items.Add(saveItem);

            //if (fieldLegalValueConfiguration.Oid != Guid.Empty) {

            //    RibbonButtonItem deleteItem = new RibbonButtonItem
            //    {
            //        Name = "Delete",
            //        Text = "Delete",
            //        Size = RibbonItemSize.Large
            //    };
            //    deleteItem.LargeImage.IconID = "actions_close_32x32";
            //    group.Items.Add(deleteItem);
            //}

            tab.Groups.Add(group);
            ribbon.Tabs.Add(tab);
            ribbon.ShowTabs = false;
            ShowRibbon(ribbon);
        }