diff --git a/controls/calendar/properties-and-events.md b/controls/calendar/properties-and-events.md index c32c86847..a3b3d8abf 100644 --- a/controls/calendar/properties-and-events.md +++ b/controls/calendar/properties-and-events.md @@ -15,7 +15,7 @@ previous_url: calendar-overview-important-events, calendar-overview-important-pr | ------ | ------ | | __AllowMultipleSelect__ |Enables multiple selection of items.| | __ShowNavigation__ |Gets or sets whether the navigation controls in the title section will be displayed.| -| __FocusedDate__ |Gets or sets the value that is used by RadCalendar to determine the viewable area displayed.| +| __FocusedDate__ |Gets or sets the value that is used by RadCalendar to determine the viewable area displayed. When synchronizing the visible view with __SelectedDate__, make sure the calendar is not read-only. The focused date is limited to the __RangeMinDate__ and __RangeMaxDate__ values.| | __HeaderNavigationMode__ |Gets or sets the navigation mode that will be used when the user clicks on header element. By default its value is HeaderNavigationMode. *Popup* | | __MonthLayout__ |Specifies the number or rows and columns for the layout.| | __MonthStep__ |Gets or sets a value determining how many months will be in the popup of the calendar. Setting it to 12/24/36/etc will allow you to show years instead of months.| diff --git a/controls/commandbar/how-to/display-calendar-in-dropdown-button.md b/controls/commandbar/how-to/display-calendar-in-dropdown-button.md new file mode 100644 index 000000000..e304bcf2c --- /dev/null +++ b/controls/commandbar/how-to/display-calendar-in-dropdown-button.md @@ -0,0 +1,40 @@ +--- +title: Display a calendar in a CommandBarDropDownButton +page_title: Display a Calendar in a CommandBarDropDownButton - WinForms CommandBar +description: Learn how to display a RadCalendar in a CommandBarDropDownButton dropdown. +slug: winforms/commandbar/how-to/display-calendar-in-dropdown-button +tags: commandbar,calendar,dropdown +published: True +position: 4 +--- + +# Display a calendar in a CommandBarDropDownButton + +Use a __RadMenuHostItem__ to add a __RadCalendar__ control to the dropdown menu of a __CommandBarDropDownButton__. Set the calendar minimum size before adding it so the dropdown menu can measure the hosted control. + +## Adding a calendar to the dropdown + +The following example creates a calendar, hosts it in a menu item, and adds the item to a command bar dropdown button. + +```csharp +RadCalendar calendar = new RadCalendar +{ + MinimumSize = new Size(250, 200) +}; + +RadMenuHostItem calendarItem = new RadMenuHostItem(calendar); +CommandBarDropDownButton calendarButton = new CommandBarDropDownButton +{ + Text = "Calendar" +}; + +calendarButton.Items.Add(calendarItem); +commandBarStripElement.Items.Add(calendarButton); +``` + +The __RadCalendar__ is displayed when the user clicks the dropdown arrow on the __CommandBarDropDownButton__. Use the calendar properties and events to configure or respond to date selection. + +## See Also + +* [CommandBar Structure]({%slug winforms/commandbar/structure%}) +* [Calendar Properties and Events]({%slug winforms/calendar/important-events%}) \ No newline at end of file diff --git a/controls/commandbar/structure.md b/controls/commandbar/structure.md index 6c7575552..eda866208 100644 --- a/controls/commandbar/structure.md +++ b/controls/commandbar/structure.md @@ -68,9 +68,9 @@ You can add these item types to the __CommandBarStripElement__ from the context |CommandBarDropDownList|![WinForms RadCommandBar CommandBarDropDownList](images/commandbar-item-types004.png)|Displays a dropdown list. Use the SelectedIndexChanged and SelectedValueChanged events to respond to user choices.| |CommandBarLabel|![WinForms RadCommandBar CommandBarLabel](images/commandbar-item-types005.png)|Displays static text on a strip element. Set the Text property to change the content.| |CommandBarSeparatorItem|![WinForms RadCommandBar CommandBarSeparatorItem](images/commandbar-item-types006.png)|Adds empty space between other elements on a strip element.| -|CommandBarDropDownButton|![WinForms RadCommandBar CommandBarDropDownButton](images/commandbar-item-types007.png)|Displays a button with a drop-down arrow. Clicking the drop-down arrow displays a menu of choices. Use the Items property to populate the menu. Attach event handlers for individual element events in code to respond to user actions.| +|CommandBarDropDownButton|![WinForms RadCommandBar CommandBarDropDownButton](images/commandbar-item-types007.png)|Displays a button with a drop-down arrow. Clicking the drop-down arrow displays a menu of choices. Use the Items property to populate the menu. To host a WinForms control in the dropdown, use a __RadMenuHostItem__. Attach event handlers for individual element events in code to respond to user actions.| |CommandBarSplitButton|![WinForms RadCommandBar CommandBarSplitButton](images/commandbar-item-types008.png)|Displays a button with a drop-down arrow. Clicking the drop-down arrow displays a menu of choices. Clicking the button has the same effect as clicking the default item from the menu.| -|CommandBarHostItem|![WinForms RadCommandBar CommandBarHostItem](images/commandbar-item-types009.png)|Item that can host any RadElement. Use the **HostedItem** property to get/set the element that you are hosting. Please check the example [WinForms RadCommandBar here]({%slug host-element-in-commandbar%}).| +|CommandBarHostItem|![WinForms RadCommandBar CommandBarHostItem](images/commandbar-item-types009.png)|Item that can host a __RadElement__ or a WinForms control directly in the CommandBar strip. Use the **HostedItem** or **HostedControl** property to get/set the element or control that you are hosting. To host a control in a __CommandBarDropDownButton__ dropdown, use a __RadMenuHostItem__ as shown in [Display a calendar in a CommandBarDropDownButton]({%slug winforms/commandbar/how-to/display-calendar-in-dropdown-button%}).| |CommandBarMaskedEditBox|![WinForms RadCommandBar CommandBarMaskedEditBox](images/commandbar-item-types010.png)|Displays [WinForms RadCommandBar RadMaskedEditBox]({%slug winforms/editors/maskededitbox%}).| diff --git a/controls/dock/docking-usercontrols-and-forms/getting-started.md b/controls/dock/docking-usercontrols-and-forms/getting-started.md index 51c23bf1e..57873bc98 100644 --- a/controls/dock/docking-usercontrols-and-forms/getting-started.md +++ b/controls/dock/docking-usercontrols-and-forms/getting-started.md @@ -13,6 +13,8 @@ previous_url: dock-docking-usercontrols-and-forms-getting-started In order to dock your **UserControls** and **Forms** in __RadDock__, you just need to use the **DockControl** method. This method will dock a Form, a **UserControl**, or simply any **Control**. A **HostWindow** with **DockType** *ToolWindow* will be created to host the **Control**. +To prevent a Form from being added to __RadDock__, do not call the **DockControl** method for that Form. For Forms that are added as MDI children, see [Automatic MDI Form Handling]({%slug winforms/dock/mdi-mode/automatic-mdi-form-handling%}) and leave the __AutoDetectMdiChildren__ property set to *false*. + For example, the following code snippet will result in the screenshot shown below: #### Docking a Form diff --git a/controls/dock/mdi-mode/automatic-mdi-form-handling.md b/controls/dock/mdi-mode/automatic-mdi-form-handling.md index 0e29e4972..8e32f48d3 100644 --- a/controls/dock/mdi-mode/automatic-mdi-form-handling.md +++ b/controls/dock/mdi-mode/automatic-mdi-form-handling.md @@ -20,7 +20,7 @@ To configure your MDI application to use this feature: 1\. First designate which form that will act as MDI container.  Set the parent form __IsMdiContainer__ property to *true*. This can be done at design time or in code (see code example below). -2\. Drop a __RadDock__ onto the parent form and set the __AutoDetectMdiChildForms__ property to *true*. You may also want to set the __RadDock.Dock__ property to __Fill__ to get the best use of space on the form. +2\. Drop a __RadDock__ onto the parent form and set the __AutoDetectMdiChildren__ property to *true*. You may also want to set the __RadDock.Dock__ property to __Fill__ to get the best use of space on the form. #### Configuring the Parent Form @@ -28,6 +28,9 @@ To configure your MDI application to use this feature: + +To prevent __RadDock__ from automatically adding MDI child forms, leave the __AutoDetectMdiChildren__ property set to *false*. This is the default value. If your code explicitly calls __DockControl__ for a form, that call still registers the form with __RadDock__. + 3\. Add a form to the project that will serve the role of child form. No properties, methods or event handlers need to be set for this form, except that you may want to add some content that will be visible when the child forms are displayed as tabbed documents. diff --git a/controls/editors/spineditor/working-with-radspineditor.md b/controls/editors/spineditor/working-with-radspineditor.md index 257b034e5..bef249ea9 100644 --- a/controls/editors/spineditor/working-with-radspineditor.md +++ b/controls/editors/spineditor/working-with-radspineditor.md @@ -9,7 +9,7 @@ position: 4 previous_url: editors-spineditor-working-with-radspineditor --- -# Properties +## Properties |Property|Description | |---|---| @@ -29,12 +29,21 @@ previous_url: editors-spineditor-working-with-radspineditor >note **DecimalPlaces** is considered when you try to commit a new value to RadSpinEditor. That is why it is expected to round the value if less decimal places are specified than the contained in the value. -# Events +## Events |Event|Description| |---|---| |__ValueChanging__|This event fires before the value has changed and allows you to prevent a given value from being entered. The event passes a __ValueChangingEventArgs__ parameter that includes the __OldValue__, __NewValue__ and __Cancel__ properties.| |__ValueChanged__|This event fires when the number has already changed. Use the __Value__ property to get the current number in the __RadSpinEditor__.| +## Troubleshooting ValueChanged + +The `ValueChanged` event is raised only when the effective value changes. If clicking an up or down button does not raise the event, check the following conditions: + +* Confirm that `ShowUpDownButtons` is enabled and `ReadOnly` is set to `false`. +* Confirm that the attempted step is not constrained to the current value by the `Minimum` or `Maximum` property. +* Check the `ValueChanging` event handler. Setting `ValueChangingEventArgs.Cancel` to `true` prevents the new value from being committed and `ValueChanged` from being raised. +* Remember that `ValueChanged` reports a value change; it is not a button-click notification. First verify whether the displayed `Value` changes when the button is clicked. + # See Also * [Getting Started]({%slug winforms/editors/spineditor/getting-started%}) diff --git a/controls/gridview/features/context-menus/modifying-the-default-context-menu.md b/controls/gridview/features/context-menus/modifying-the-default-context-menu.md index 2e89cfd4a..e1fbe99b7 100644 --- a/controls/gridview/features/context-menus/modifying-the-default-context-menu.md +++ b/controls/gridview/features/context-menus/modifying-the-default-context-menu.md @@ -32,6 +32,48 @@ In order to add custom menu items to the default context menu, *you should creat >note You can subscribe to the **Click** event of the newly added menu items and thus execute the desired action when a **RadMenuItem** is clicked. +## Changing the Size of a Context Menu Item + +The items in the default **RadGridView** context menu are **RadMenuItem** instances hosted by a **RadDropDownMenu**. To change an item's width or height, find the item in the **ContextMenuOpening** event handler, set **AutoSize** to *false*, and assign the desired **Size**. + +The following example sets the size of the **Delete Row** item. Replace the item text with the text of the menu item that you want to customize. + +````C# +using System.Drawing; + +private void RadGridView1_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e) +{ + for (int i = 0; i < e.ContextMenu.Items.Count; i++) + { + RadMenuItem menuItem = e.ContextMenu.Items[i] as RadMenuItem; + if (menuItem != null && menuItem.Text == "Delete Row") + { + menuItem.AutoSize = false; + menuItem.Size = new Size(200, 40); + break; + } + } +} +```` + +````VB.NET +Imports System.Drawing + +Private Sub RadGridView1_ContextMenuOpening(sender As Object, e As ContextMenuOpeningEventArgs) + For i As Integer = 0 To e.ContextMenu.Items.Count - 1 + Dim menuItem As RadMenuItem = TryCast(e.ContextMenu.Items(i), RadMenuItem) + If menuItem IsNot Nothing AndAlso menuItem.Text = "Delete Row" Then + menuItem.AutoSize = False + menuItem.Size = New Size(200, 40) + Exit For + End If + Next +End Sub +```` + +Set **AutoSize** to *false* before assigning **Size** so the item keeps the specified dimensions. Apply the setting in the **ContextMenuOpening** event so it is applied whenever the default context menu is displayed. + + The result of combining the approaches from this article is shown on the screenshot below: ![WinForms RadGridView Modified Default ContextMenu](images/gridview-context-menus-modifying-the-default-context-menu001.png) diff --git a/controls/gridview/features/exporting-data/spread-export.md b/controls/gridview/features/exporting-data/spread-export.md index d84326c72..b1de21538 100644 --- a/controls/gridview/features/exporting-data/spread-export.md +++ b/controls/gridview/features/exporting-data/spread-export.md @@ -25,7 +25,7 @@ This article explains in detail the **SpreadExport** abilities and demonstrates The following images show how a grid looks when you export it:
![Telerik UI for WinForms RadGridView showing the original grid data before spread export](images/gridview-exporting-data-spread-export001.png)![Telerik UI for WinForms RadGridView exported worksheet showing the grid data in Excel format](images/gridview-exporting-data-spread-export002.png) ->note The spread export functionality requires the __TelerikExport.dll__ assembly. To access the types in TelerikExport, you must include the assembly in your project and reference the __Telerik.WinControls.Export__ namespace. +>note The spread export functionality requires the __Telerik.UI.for.WinForms.Export__ NuGet package, which provides the __TelerikExport.dll__ assembly. To access the types in TelerikExport, you must include the assembly in your project and reference the __Telerik.WinControls.Export__ namespace. The spread export functionality also requires the [RadSpreadProcessing Library](http://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/overview). To use this Library, you must reference the following assemblies: diff --git a/controls/menus/menu/properties-methods-events.md b/controls/menus/menu/properties-methods-events.md index 0e8352e8a..61522a198 100644 --- a/controls/menus/menu/properties-methods-events.md +++ b/controls/menus/menu/properties-methods-events.md @@ -12,13 +12,13 @@ position: 8 |Property|Description| |----|----| -|**StretchItems**|Indicates whether the menu items should be stretched to fill the available space.| +|**StretchItems**|Indicates whether the menu items should be stretched to fill the available space. See [Sizing Menu Items]({%slug winforms/menus/menu/working-with-radmenu-items/radmenuitem%}).| |**SystemKeyHighlight**|Gets or sets whether the `Alt` or `F10` keys can be used to highlight the menu.| |**MenuElement**|Gets the instance of RadMenuElement wrapped by this control. RadMenuElement is the main element in the hierarchy tree and encapsulates the actual functionality of RadMenu.| |**Items**|Gets the collection that stores the items in RadMenu.| |**AllowMerge**|Gets or sets whether the merging is allowed.| |**Orientation**|Get or sets the menu orientation.| -|**AllItemsEqualHeight**|Gets or sets whether all items will appear with the same size (the size of the highest item in the collection).| +|**AllItemsEqualHeight**|Gets or sets whether all items will appear with the same size (the size of the highest item in the collection). See [Menu Item Height]({%slug winforms/menus/menu/working-with-radmenu-items/multi-line-menu-item-text%}).| |**DropDownAnimationEnabled**|Gets or sets a value indicating whether the Drop Down animation will be enabled when it shows.| |**DropDownAnimationEasing**|Gets or sets the type of the Drop Down animation.| |**DropDownAnimationFrames**|Gets or sets the number of frames that will be used when the Drop Down is being animated.| diff --git a/controls/menus/menu/working-with-radmenu-items/radmenuitem.md b/controls/menus/menu/working-with-radmenu-items/radmenuitem.md index 9c6b8990b..82ab1c56e 100644 --- a/controls/menus/menu/working-with-radmenu-items/radmenuitem.md +++ b/controls/menus/menu/working-with-radmenu-items/radmenuitem.md @@ -52,6 +52,11 @@ The **RadMenuItem** represents a standard menu item. Some of its properties incl |__StringAlignment__|Formats the alignment of the text string so it is positioned near, center, or far from the left border of the menu item. | +## Sizing Menu Items + +Use the **AutoSizeMode** property to choose whether the item fits the available size, wraps around its children, or uses the automatic sizing behavior. If you need all items in a **RadMenu** to have the same height, use the **AllItemsEqualHeight** property on the owning **RadMenu**. For more information, see [Menu Item Height]({%slug winforms/menus/menu/working-with-radmenu-items/multi-line-menu-item-text%}). + + ## RadMenuComboItem The __RadMenuComboItem__ allows you to put a drop-down list on a menu. To add items to the combo box work with the __Items__ collection of the RadMenuComboItem.__ComboBoxElement__ property. Since the **ComboBoxElement** returns a **RadDropDownListElement**, you can also use data binding to put items in the drop-down list from any data source. diff --git a/controls/picturebox/getting-started.md b/controls/picturebox/getting-started.md index fdd6ae3cc..294ab027d 100644 --- a/controls/picturebox/getting-started.md +++ b/controls/picturebox/getting-started.md @@ -46,6 +46,16 @@ You can use the **DefaultSvgImage/DefaultImage** and **DefaultText** properties +To change the color of the default text, set the `ForeColor` property of the `NoPictureTextElement`: + +````C# +this.radPictureBox1.PictureBoxElement.NoPictureTextElement.ForeColor = System.Drawing.Color.Red; +```` + +````VB.NET +Me.radPictureBox1.PictureBoxElement.NoPictureTextElement.ForeColor = System.Drawing.Color.Red +```` + ![WinForms RadPictureBox Customize Default Look](images/picturebox-getting-started003.png)