Current filter:
                                You should refresh the page.
                                  • [DevExpress Support Team: CLONED FROM T852102: RichEditControl]

                                    I do have another question but not sure if I should open another ticket.

                                    The context menu is limited when using the richeditcontrol as a repository item. Is there a way customize this menu so I can add addition commands? (Insert Tables, Pictures, etc) . Another option could possibly be to create the full ribbon menu but I'm not sure how to reference the autogenerated ribbon menu to the richeditcontrol repository item.

                                1 Solution

                                Creation Date Importance Sort by

                                To implement the Ribbon UI for the in-place RichEditControl, you can drop RichEditControl at the form where GridControl is located, generate the ribbon using the Create All Tabs smart-tag command and remove RichEditControl from the window. After that, you will be able to attach this ribbon to the GridControl's active editor as described in the Grid Cell and RichText formatting thread.

                                As for the context menu, you need to obtain RichEditControl from the GridControl's active editor in the ShownEditor event handler and subscribe to the RichEditControl.PopupMenuShowing event to provide custom menu items. Note that you can add menu item's bound to predefined RichEdit commands using the approach from the How to: Customize and Hide the Popup Menu documentation topic.

                                Show all comments
                                • Doug Bess 01.16.2020

                                  Hi, regarding assigning the Ribbon UI to the XtraGrids active editor..... most of the ribbon command work as expected however I'm having troubles with the Font Drop Downs on the Ribbon. If I click the drop down then the XtraGrids active editor is set to nothing (It loses focus).

                                  I have another question. I would like to use the Ribbon UI to update multiple RichEditControls simultaneously. Do you have any recommendations on the best way to achieve this?

                                • Doug Bess 01.17.2020

                                  Hi. Any progress on my last questions?

                                • Mariya (DevExpress Support) 01.17.2020

                                  Hi Doug,
                                  As for the Font Name and Font Size ribbon items, this behavior is expected. These items have text editors that automatically catch the keyboard focus on item activation and thus, GridControl's editor is deactivated. I'm afraid there is no easy way to overcome this behavior. I can only suggest you remove these items from the ribbon and open the Font dialog from the context menu instead.

                                  -I would like to use the Ribbon UI to update multiple RichEditControls simultaneously.
                                  Would you please describe the required behavior in greater detail? It will help if you provide me with screenshots illustrating what you mean.

                                • Doug Bess 01.17.2020

                                  Thanks for the first answer. I have an xtragrid with an RTF column. I want to be able to apply RTF formatting to multiple grid rows simultaneously using the build in ribbon control. The ribbon works great for a single cell when the active editor is assigned to the ribbon but I'm not sure how to get the ribbon to activate for mulitple cells.

                                • Mariya (DevExpress Support) 01.17.2020

                                  Thank you for the clarification. The ribbon can be attached only to a single RichEditControl instance. Also, I noticed that you selected multiple cells with RichText content - in this case, there is no active editor that can be updated in the grid.
                                  Perhaps, you might consider an alternative approach. Build a custom form (like RichEditControl's Font dialog) and open this dialog through the context menu when multiple grid cells are selected. Then, adjust font settings and commit changes - at this step, you need to obtain RTF strings from each cell selected in the grid. Load each RTF string in a RichEditDocumentServer instance, update document formatting according to settings defined in the custom form, and post the resultant RTF string to the GridControl's data source.

                                • Doug Bess 01.17.2020

                                  Thanks. Thats what I thought, just wanted to make sure.

                                • Mariya (DevExpress Support) 01.17.2020

                                  You are welcome. Please do not hesitate to contact me if you need more help.

                                • Doug Bess 01.21.2020

                                  Hi, I am having an issue with this solution. I placed the RichEditcontrol on the form, created the RTF ribbon menu and then removed the RichEditControl. When I first open the form, all of the menu items are not visible. They do become visible after I set the active editor in the grid to the ribboncontroller. Is there anyway to at least show the menu items disabled and not hidden when there is not an active editor?

                                • Mariya (DevExpress Support) 01.22.2020

                                  Hi Doug,
                                  Ribbon images are not displayed because the required RichEdit resources are not loaded until you attach RichEditControl to the ribbon for the first time. To force resources load, you can create a RichEditControl instance at runtime, assign this instance to the RichEditBarController.RichEditControl property and then, reset this property to null.

                                  [C#]
                                  richEditBarController1.RichEditControl = new RichEditControl(); richEditBarController1.RichEditControl = null;