Hi,
I've created a grid with one editable column.
Can you please advise how I can totally disable context menu that becomes accessable when editing, or disable some specific menu points (e.g. "Insert Unicode control character", "Right to left Reading order" etc.)?
Thanks in advance.
I've created a grid with one editable column.
Can you please advise how I can totally disable context menu that becomes accessable when editing, or disable some specific menu points (e.g. "Insert Unicode control character", "Right to left Reading order" etc.)?
Thanks in advance.
5 Answers, 1 is accepted
0
Hello Yariv,
Thank you for writing.
Most of our editors internally host the standard TextBox control, thus the context menu that you are seeing is the standard TextBox context menu. To remove it, you need to access this text box and set its ContextMenu property to a new instance of ContextMenu. To access the TextBox, you need to access the editor for the edited cell. Assuming that you have GridViewTextBoxColumn, the cells in this column use RadTextBoxEditor. To access the editor you need to subscribe to the CellEditorInitialized event. Here is a sample:
I hope that you find this information useful.
Regards,
Stefan
Telerik
Thank you for writing.
Most of our editors internally host the standard TextBox control, thus the context menu that you are seeing is the standard TextBox context menu. To remove it, you need to access this text box and set its ContextMenu property to a new instance of ContextMenu. To access the TextBox, you need to access the editor for the edited cell. Assuming that you have GridViewTextBoxColumn, the cells in this column use RadTextBoxEditor. To access the editor you need to subscribe to the CellEditorInitialized event. Here is a sample:
void
radGridView1_CellEditorInitialized(
object
sender, GridViewCellEventArgs e)
{
RadTextBoxEditor editor = e.ActiveEditor
as
RadTextBoxEditor;
if
(editor !=
null
)
{
((RadTextBoxEditorElement)editor.EditorElement).TextBoxItem.HostedControl.ContextMenu =
new
ContextMenu();
}
}
I hope that you find this information useful.
Regards,
Stefan
Telerik
RadChart for WinForms is obsolete. Now what?
0
Yariv
Top achievements
Rank 1
answered on 01 Jul 2013, 08:09 AM
Hi Stefan,
Thanks a lot, it helped!
Thanks a lot, it helped!
0
Alexander
Top achievements
Rank 1
answered on 17 Sep 2013, 07:14 AM
It works for string type, but if column fill with int elements
it doesn't help.
What type instead RadTextBoxEditor I need use for INT?
it doesn't help.
What type instead RadTextBoxEditor I need use for INT?
0
Alexander
Top achievements
Rank 1
answered on 17 Sep 2013, 07:37 AM
Oh! I find it: GridSpinEditor)
0
Hello Alexander,
Nikolay
Telerik
Indeed, GridSpinEditor is the editor that you need when working with numbers. I am glad that you managed to find the answer and your case is resolved.
Regards,Nikolay
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>