Telerik Forums
UI for WinForms Forum
1 answer
12 views

Is there a way to give each ContextMenu Item its own backcolor?

Dinko | Tech Support Engineer
Telerik team
 answered on 02 Apr 2024
1 answer
25 views

Hi,

I use the RadSpellChecker for some Textbox Controls and it worked great.

But when I have words with more than 9 letters, I don't get the contextmenu die Add these Words to the dictonary.

Any Idead to solve this problem?

Attached a screenshot with the contextmenu on a word with max 9 letters and a screenshot with more than 9 letters.

 

Thank you

Nadya | Tech Support Engineer
Telerik team
 answered on 20 Dec 2023
1 answer
71 views

Hi,

We are using RadContextMenu (winforms).
It works fine.

But we would like to remove/hide the icon column because in most cases our items don't have icon/image.

Do you know if it is possible ?

Thanks.

Alain.

Nadya | Tech Support Engineer
Telerik team
 answered on 16 Oct 2023
1 answer
50 views

how do I move the pre-built "Delete Row" option to the bottom or move my options to the top?


		private void dgvSIQ_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
		{
			RadMenuItem mniProcess = new RadMenuItem();
			RadMenuItem mniVendorInquiry = new RadMenuItem();
			RadMenuSeparatorItem mniSeparate = new RadMenuSeparatorItem();

			e.ContextMenu.Items[0].Visibility = ElementVisibility.Collapsed;
			e.ContextMenu.Items[1].Visibility = ElementVisibility.Collapsed;

			mniProcess.Text = "Process PO";
			mniVendorInquiry.Text = "Vendor Inquiry";
			//e.ContextMenu.Items.Add(mniSeparate);
			e.ContextMenu.Items.Add(mniVendorInquiry);
			e.ContextMenu.Items.Add(mniProcess);

			try
			{
				mniProcess.Click += mniProcess_Click;
				mniVendorInquiry.Click += mniVendorInquiry_Click;
			}
			catch (Exception)
			{
			}

		}

Dinko | Tech Support Engineer
Telerik team
 answered on 24 Aug 2023
1 answer
68 views

Hello.  Our application is using Telerik WinControls from Q1 2022.

We have a number of context menus where we wish to conditionally disable menu items and show a tooltip that explains why the menu item is disabled.  The problem is that when the menu item is disabled then no tooltip is displayed!

How do we get tooltips to display even when the menu item is disabled?

In the following example we would not see the tooltip when menuItem.Enabled = false;  Can we get a fix for this?  Our work-around is causing other problems.

RadContextMenu contextMenu = new RadContextMenu();

RadMenuItem menuItem = new RadMenuItem("View in Browser");

contextMenu.Items.Add(menuItem);

if (supportsBrowser())

{

     menuItem.Tooltip = "Open your browser";

}

else

{

     menuItem.Enabled = false;

     menuItem.Tooltip = "This device does not support browser access.";

}

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 23 Aug 2023
1 answer
46 views

I have several RadTextBox controls on a form and want to use a single RadContextMenu to provide my own context menu. Depening on which control is selected the resulting action will be a little different. 

I have this code to assign my context menus to the 2 controls.

this.txtBreedersAccount.TextBoxElement.TextBoxItem.HostedControl.ContextMenu = new ContextMenu();
this.txtBreedersAccount.TextBoxElement.TextBoxItem.HostedControl.MouseDown += new MouseEventHandler(this.AccountContextMenu_MouseDown);
this.txtMemberAccount.TextBoxElement.TextBoxItem.HostedControl.ContextMenu = new ContextMenu();
this.txtMemberAccount.TextBoxElement.TextBoxItem.HostedControl.MouseClick += new MouseEventHandler(this.AccountContextMenu_MouseDown);

This is my MouseDown procedure.

   private void AccountContextMenu_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {                
                this.cmnuAccount.Show(MousePosition);
            }
        }

All of this works perfectly. My issue is the I can't seem to find a way to determine which of my 2 controls was actually used to instantiate the RadContextMenu. Searching the closest I could get was something like this, but it doesn't work.

        private void cmnuAccount_DropDownOpening(object sender, System.ComponentModel.CancelEventArgs e)
        {
            RadElement element = sender as RadElement;

            if (element == null)
            {
                return;
            }

            this._currentControl = element.ElementTree.Control as RadControl;
        }

Textboxes seem to be treated differently than other RadControls. If I setup the context menu on a checkbox for example it work without any issues.

I'd appreciate any help that anyone could give. Thanks.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 15 Aug 2023
1 answer
45 views

Basically, I have a function that deals with various items, based on what the user clicked on.

So when they right click on say a label and I open my context menu, how do I figure out what label (object) it was that they clicked on?

I could do an event for every label, but that seems... bad. 

I attempted to use the event DropDownOpening to see if I could access the sender for the right click to open the menu, but haven't had any luck there.

Dinko | Tech Support Engineer
Telerik team
 answered on 06 Jun 2023
1 answer
93 views

According to this page: https://docs.telerik.com/devtools/winforms/controls/menus/contextmenu/context-menus

I should be able to assign a radcontextmenu to the contextmenu of the radsyntaxeditor.  However, I'm finding that not to be the case as you can see below.  my contextmenu named ctxMenuEditor is of type radContextMenu.  

The below screenshots should show the problem I think.  Basically, for whatever reason, the radsyntaxeditor doesn't accept the radcontextmenu, just contextmenu object type. 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 09 Feb 2023
3 answers
85 views

Hi all,

I wish to open a DropDown list in a context menu when a user right click on a GridView cell and handle the click event on an element of this DropDown list.

I am a bit lost between the GridView context menu documentation and the one specific to general context menus

I tried using the RadMenuComboItem (as described in this document) but the result is no satisfactory.  

Would someone have a simple example on how to do this ?

Many thanks

Patrick

Patgat
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 13 Jan 2023
2 answers
77 views

Hello all!

I'm working with a use case where I can't allow the user to edit an inserted image - we're not saving the bytes, just the URL the image comes from, so the user editing the image would just be wasted time.

I've disabled the 'CanDrag', 'CanResize', and 'CanRotate' on the ImageSelectinoAdornerSettings layer. I even tried removing the layer per a forum post I found - however if I right click on the image, I see get a functional 'Edit Image' option on the context menu.

I've looked at the RadRichTextEditor Context Menu article (https://docs.telerik.com/devtools/winforms/controls/richtexteditor/ui-for-applying-rich-text-formatting/context-menu), but it doesn't show how to loop through the groups and/or the menu items themselves, and I'm hitting a wall when I try to figure that out myself.

Any suggestions on how to remove the Edit Image context menu item?

Thank you!

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 Aug 2022
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
Buttons, RadioButton, CheckBox, etc
DropDownList
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
Tabstrip (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
GanttView
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
VirtualGrid
Spreadsheet
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
Rotator
TrackBar
MessageBox
CheckedDropDownList
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
CAB Enabling Kit
TabbedForm
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ImageEditor
ScrollBar
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
VirtualKeyboard
FilterView
Accessibility
DataLayout
NavigationView
ToastNotificationManager
CalculatorDropDown
Localization
TimePicker
ValidationProvider
FontDropDownList
Licensing
BreadCrumb
ButtonTextBox
LocalizationProvider
Dictionary
Overlay
Security
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
Flyout
TaskbarButton
HeatMap
SlideView
PipsPager
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?