Telerik Forums
UI for WinForms Forum
0 answers
63 views

Is there a simple way to enable a different context menu for each level of a hierarchical grid?   

I only see ContextMenuOpening for the grid as a whole and don't see a way to determine which sub grid was selected which didn't involve checking column names. The templates only seem they are there to support layout.

Attached is a sample app.

Thanks,

_Dave

Dave
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 29 Oct 2024
1 answer
58 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
73 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
203 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
138 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
181 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
139 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
97 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
177 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
180 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
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
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
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
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?