1 Solution
Hi Cristian,
Thank you for your inquiry.
In fact, our editors use the standard TextBox control to show data. Thus, this context menu is a standard context menu of the TextBox control. You can translate it using general .NET facilities as shown in the following threads:
- .NET Framework Developer Center;
- Textbox ContextMenu localization.
As for the second issue, this error is created by the .Net Framework. Thus, the exception text cannot be localized at our control level. However, you can customize an editor's template by overriding the BaseEdit.ErrorToolTipContentTemplate data template.
If you have additional questions, feel free to reactivate this thread.
Thanks
-
Hi Ivan,
There is any solution to disable the context menu?
-
I have found the kind to disable this control. For each control I put the context menu visibility to Hidden, and its work for me, but on dataGrid control I don't know how to hidden this. Any solution?
-
Hi Cristian,
Please define an implicit style for the TextEdit control within the grid's Resources section as follows:
<dxg:GridControl.Resources> <Style TargetType="dxe:TextEdit"> <Setter Property="ContextMenu"> <Setter.Value> <ContextMenu Visibility="Collapsed"/> </Setter.Value> </Setter> </Style> </dxg:GridControl.Resources>If editors of different types are used in your grid, you can add several different implicit styles or handle a TableView's ShownEditor event as follows:
private void view_ShownEditor(object sender, DevExpress.Xpf.Grid.EditorEventArgs e) { ((BaseEdit)e.Editor).ContextMenu = new ContextMenu() { Visibility = Collapsed }; } -
Hi Dmitry,
I create the following class to appliy your solution, but this is not working for me.
public class SITecTableViewDE : TableView
{
public SITecTableViewDE()
{
}
protected override void OnShowEditor(CellEditorBase editor)
{
base.OnShowEditor(editor);editor.ContextMenu = new System.Windows.Controls.ContextMenu();
editor.ContextMenu.Visibility = System.Windows.Visibility.Collapsed;
}
} -
Thank you for your response and providing the sample code.
The problem is that the editor is not yet completely initialized when the OnShowEditor method is called. It is better to override the RaiseShownEditor method for this purpose. Change the code as follows:
public class MyTableView: TableView { protected override void RaiseShownEditor(EditorEventArgs e) { base.RaiseShownEditor(e); BaseEdit editor = e.Editor as BaseEdit; editor.ContextMenu = new ContextMenu(); editor.ContextMenu.Visibility = System.Windows.Visibility.Collapsed; } }This should fix the problem.
-
Thanks, it's working fine.
-
You are welcome!
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.