Skip to content

Commit a6e3018

Browse files
Merge pull request #3095 from telerik/stennlyy/d-Document-new-properties-of-MCCB-and-Menu
Document the new properties of the MCCB and Menu
2 parents a51b569 + 7bbf166 commit a6e3018

File tree

3 files changed

+71
-47
lines changed

3 files changed

+71
-47
lines changed

controls/radmenu/features/icons.md

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Icons
33
page_title: Icons
4-
description: Check our "Icons" documentation article for the RadMenu {{ site.framework_name }} control.
4+
description: Check our "Icons" documentation article for the RadMenu WPF control.
55
slug: radmenu-features-icons
66
tags: icons
77
published: True
@@ -10,16 +10,15 @@ position: 5
1010

1111
# Icons
1212

13-
The __RadMenu__ allows you to display an icon for each of the menu items. This can be done by setting the __Icon__ property of the __RadMenuItem__. For the icon to be displayed as expected, you have to either provide an element of type __Image__ for it or also set the **IconTemplate** property of the item.
13+
The `RadMenu` allows you to display an icon for each of the menu items. This can be done by setting the `Icon` property of the `RadMenuItem`. For the icon to be displayed as expected, you have to either provide an element of type `Image` for it or also set the `IconTemplate` property of the item.
1414

1515
## Setting the Icon of a Static Item
1616

17-
>tipTo learn more about this way of populating the __RadMenu__ with static data take a look at the [Using Static Items]({%slug radmenu-populating-with-data-using-static-items%}) topic.
17+
>tipTo learn more about this way of populating the RadMenu with static data take a look at the [Using Static Items]({%slug radmenu-populating-with-data-using-static-items%}) topic.
1818
19-
When using static items you can directly access the __Icon__ property of each item. Respectively you can set it directly:
20-
21-
__Example 1: Setting the Icon property declaratively__
19+
When using static items you can directly access the Icon property of each item. Respectively you can set it directly:
2220

21+
__Setting the Icon property declaratively__
2322
```XAML
2423
<telerik:RadMenuItem Header="New File">
2524
<telerik:RadMenuItem.Icon>
@@ -29,22 +28,19 @@ __Example 1: Setting the Icon property declaratively__
2928
</telerik:RadMenuItem>
3029
```
3130

32-
**Figure 1** illustrates the resulting items.
33-
34-
#### Figure 1: RadMenuItems with their Icon property set
31+
__RadMenuItems with their Icon property set__
3532

3633
![RadMenuItems with their Icon property set](images/RadMenu_Features_Icons_01.png)
3734

3835
## Setting the Icon of a Dynamic Item
3936

40-
>tipTo learn more about this way of populating the __RadMenu__ with dynamic data take a look at the [Binding to Dynamic Data]({%slug radmenu-populating-with-data-binding-to-dynamic-data%}) topic.
37+
>tipTo learn more about this way of populating the RadMenu with dynamic data take a look at the [Binding to Dynamic Data]({%slug radmenu-populating-with-data-binding-to-dynamic-data%}) topic.
4138
42-
When using dynamic items, you have to bind the __Icon__ property to a property of the data item. The specific here is that your data item needs to either expose a property of type __Image__, so the __Icon__ property can be bound properly or you need to define the **IconTemplate** property of the menu items if you wish to bind it to a **string** or **Uri**, for example.
39+
When using dynamic items, you have to bind the Icon property to a property of the data item. The specific here is that your data item needs to either expose a property of type Image, so the Icon property can be bound properly or you need to define the IconTemplate property of the menu items if you wish to bind it to a `string` or `Uri`, for example.
4340

4441
Let's assume you've defined the following class which exposes the icon Uri as well as a read-only property which returns an image from this Uri.
4542

46-
__Example 2: MenuItem class with Uri and Image properties__
47-
43+
__MenuItem class with Uri and Image properties__
4844
```C#
4945
public class MenuItem
5046
{
@@ -90,12 +86,11 @@ __Example 2: MenuItem class with Uri and Image properties__
9086
End Class
9187
```
9288

93-
You can then bind the Icon using any of the two properties. Following the example from the [Binding to Dynamic Data]({%slug radmenu-populating-with-data-binding-to-dynamic-data%}) article, you can add the following setters to **ItemContainerStyle**.
89+
You can then bind the Icon using any of the two properties. Following the example from the [Binding to Dynamic Data]({%slug radmenu-populating-with-data-binding-to-dynamic-data%}) article, you can add the following setters to `ItemContainerStyle`.
9490

9591
* If you wish to bind directly to a property of type Image:
9692

97-
__Example 2: Setting the Icon property to an Image__
98-
93+
__Setting the Icon property to an Image__
9994
```XAML
10095
<!-- If you are using the NoXaml binaries, you will have to base the style on the default one for the theme like so:
10196
<Style TargetType="telerik:RadMenuItem" BasedOn="{StaticResource RadMenuItemStyle}">-->
@@ -108,8 +103,7 @@ You can then bind the Icon using any of the two properties. Following the exampl
108103

109104
* If you wish to bind directly to a property of type Uri/string:
110105

111-
__Example 3: Setting the Icon property to an Uri/string__
112-
106+
__Setting the Icon property to an Uri/string__
113107
```XAML
114108
<!-- If you are using the NoXaml binaries, you will have to base the style on the default one for the theme like so:
115109
<Style TargetType="telerik:RadMenuItem" BasedOn="{StaticResource RadMenuItemStyle}">-->
@@ -131,10 +125,35 @@ You can then bind the Icon using any of the two properties. Following the exampl
131125

132126
Both approaches will lead to the same results as when you set the icon declaratively.
133127

134-
#### Figure 2: Dynamic RadMenuItems with their icons
128+
__Dynamic RadMenuItems with their icons__
135129

136130
![Dynamic RadMenuItems with their icons](images/RadMenu_Features_Icons_01.png)
137131

132+
## Setting the Icon Position
133+
134+
The `RadMenuItem` element exposes the `ItemIconPosition` property that allows for specifying the location of the icon. It is of the type of `ItemIconPosition`, which exposes the following two options:
135+
136+
* `Left`&mdash;The icon will be displayed on the left side of the RadMenuItem's content. This is the default value.
137+
* `Right`&mdash;The icon will be displayed on the right side of the RadMenuItem's content.
138+
139+
__Setting the ItemIconPosition property to Right__
140+
```XAML
141+
<telerik:RadMenu>
142+
<telerik:RadMenuItem Header="Options">
143+
<telerik:RadMenuItem Header="Save" ItemIconPosition="Right">
144+
<telerik:RadMenuItem.Icon>
145+
<Image Source="/Images/save.png"
146+
Stretch="UniformToFill"/>
147+
</telerik:RadMenuItem.Icon>
148+
</telerik:RadMenuItem>
149+
</telerik:RadMenuItem>
150+
</telerik:RadMenu>
151+
```
152+
153+
__RadMenuItem with its icon positioned on the right__
154+
155+
![RadMenuItem with its icon positioned on the right](images/menu-features-icon-2.png)
156+
138157
## See Also
139158

140159
* [Checkable Items]({%slug radmenu-features-checkable-items%})
3 KB
Loading

controls/radmulticolumncombobox/key-properties-and-methods.md

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Key Properties and Methods
33
page_title: Key Properties and Methods
4-
description: Check our &quot;Key Properties and Methods&quot; documentation article for the RadMultiColumnComboBox {{ site.framework_name }} control.
4+
description: Check our &quot;Key Properties and Methods&quot; documentation article for the RadMultiColumnComboBox WPF control.
55
slug: multicolumncombobox-dropdown-key-properties-and-methods
66
tags: key, properties, methods
77
published: True
@@ -10,21 +10,21 @@ position: 6
1010

1111
# Key Properties and Methods
1212

13-
The article lists the most important properties and methods of __RadMultiColumnComboBox__.
13+
The article lists the most important properties and methods of `RadMultiColumnComboBox`.
1414

1515
## Text Change Without Delay
1616

17-
By default, the reaction of __RadMultiColumnComboBox__ to a text change will be deferred. In case when updating needs to be done immediately, the __DeferTextChange__ property can be set to __False__.
17+
By default, the reaction of RadMultiColumnComboBox to a text change will be deferred. In case when updating needs to be done immediately, the `DeferTextChange` property can be set to __False__.
1818

1919
## Disable Items Highlighting
2020

21-
With all settings for its __AutoCompleteMode, RadMultiColumnComboBox__ will highlight its items. This can be switched off by setting the __HighlightMatches__ property to __False__.
21+
With all settings for its AutoCompleteMode, RadMultiColumnComboBox will highlight its items. This can be switched off by setting the `HighlightMatches` property to __False__.
2222

2323
## Setting Text for an Empty Selection
2424

25-
When there is no selection applied, the control will display an empty AutoCompleteBox. In case a custom text needs to be displayed in it, the __NullText__ property comes in handy.
25+
When there is no selection applied, the control will display an empty AutoCompleteBox. In case a custom text needs to be displayed in it, the `NullText` property comes in handy.
2626

27-
__Example 1: Setting the NullText property__
27+
__Setting the NullText property__
2828
```XAML
2929
<telerik:RadMultiColumnComboBox VerticalAlignment="Top" DisplayMemberPath="Name"
3030
NullText="Please enter input">
@@ -34,51 +34,56 @@ __Example 1: Setting the NullText property__
3434
</telerik:RadMultiColumnComboBox>
3535
```
3636

37-
#### __Figure 1: MultiColumnComboBox with NullText set__
37+
__MultiColumnComboBox with NullText set__
38+
3839
![MultiColumnComboBox with NullText set](images/MultiColumnComboBox_KeyProperties_01.png)
3940

4041
## Open,Close and Toggle the DropDown
4142

4243
The following set of methods is provided for manipulating the visibility of the DropDown.
4344

44-
* __OpenDropDown__: Opens the DropDown if it is closed.
45-
* __CloseDropDown__: Closes the DropDown if it is opened.
46-
* __ToggleDropDown__: Toggles the opened/closed state of the DropDown.
45+
* `OpenDropDown`&mdash;Opens the DropDown if it is closed.
46+
* `CloseDropDown`&mdash;Closes the DropDown if it is opened.
47+
* `ToggleDropDown`&mdash;Toggles the opened/closed state of the DropDown.
4748

48-
## DropDownElementStyle
49+
## Drop Down Element Style
4950

50-
Since __R1 2019 SP1__, RadMultiColumnComboBox exposes the __DropDownElementStyle__ property. Through it, you can get or set a Style that will be applied to the dropdown element.
51+
RadMultiColumnComboBox exposes the `DropDownElementStyle` property. Through it, you can get or set a Style that will be applied to the dropdown element.
5152

5253
> The TargetType of the Style should match the type of the dropdown element.
5354
5455
## Search Mode
5556

56-
With **R2 2019** we introduced a new **SearchMode** property which allows you to control how items are matched when search is executed. It has the following two possible values:
57-
58-
* **MatchAnyTerm**: Items match the search operation when they fulfill any of the search terms. For example, if `John Terry` is inputted, items containing **any** of the terms "John" and "Terry" in any of their properties will be matched. This is the **default** value.
59-
* **MatchAllTerms**: Items match the search operation only when they fulfill all of the search terms. Continuing with the previous example, if `John Terry` is entered as the search text, only items which contain **both** terms ("John" and "Terry") in any of their properties will be matched.
60-
61-
>important The SearchMode property takes effect only if the **AutoCompleteMode** of the control is **Search**.
57+
The RadMultiColumnComboBox exposes a new `SearchMode` property which allows you to control how items are matched when search is executed. It has the following two possible values:
6258

63-
## SelectionOnFocus
59+
* `MatchAnyTerm`&mdash;Items match the search operation when they fulfill any of the search terms. For example, if `John Terry` is inputted, items containing __any__ of the terms "John" and "Terry" in any of their properties will be matched. This is the default value.
60+
* `MatchAllTerms`&mdash;Items match the search operation only when they fulfill all of the search terms. Continuing with the previous example, if `John Terry` is entered as the search text, only items which contain __both__ terms ("John" and "Terry") in any of their properties will be matched.
6461

65-
With the **R3 2020 SP1 version**, the __SelectionOnFocus__ property of the __RadMultiColumnComboBox__ control was introduced, which allows you to specify what will happen with the cursor when the control gets focus.
62+
>important The SearchMode property takes effect only if the `AutoCompleteMode` of the control is `Search`.
6663
67-
> This property is respected when the **SelectionBoxesVisibility** property is set to **Collapsed**.
64+
## Selection On Focus
6865

69-
The values for the __SelectionOnFocus__ property are predefined in the __SelectionOnFocus__ enumeration. It exposes the following members:
66+
The RadMultiColumnComboBox control exposes the `SelectionOnFocus` property, which allows you to specify what will happen with the cursor when the control gets focus.
7067

71-
* __SelectAll__: Once the control is focused, it will select its whole text.
68+
> This property is respected when the `SelectionBoxesVisibility` property is set to `Collapsed`.
7269
73-
* __CaretToBeginning__: Once the control is focused, the cursor will be positioned at its beginning.
70+
The values for the SelectionOnFocus property are predefined in the `SelectionOnFocus` enumeration. It exposes the following members:
7471

75-
* __CaretToEnd__: Once the control is focused, the cursor will be positioned at its end.
72+
* `SelectAll`&mdash;Once the control is focused, it will select its whole text.
73+
* `CaretToBeginning`&mdash;Once the control is focused, the cursor will be positioned at its beginning.
74+
* `CaretToEnd`&mdash;Once the control is focused, the cursor will be positioned at its end.
75+
* `Unchanged`&mdash;Once the control is focused, the cursor's position won't be changed. This is the default value for the SelectionOnFocus property.
76+
* `Default`&mdash;Once the control is focused, the cursor will be positioned at its end.
77+
* `DefaultSelectAll`&mdash;This property changes the SelectionOnFocus behavior of the control depending on the source of the focus. If the control is focused on mouse click, the Default SelectionOnFocus behavior will be used. If, on the other hand, the control is focused using the __Tab__ key, the SelectAll SelectionOnFocus behavior will be used.
7678

77-
* __Unchanged__: Once the control is focused, the cursor's position won't be changed. This is the __default value__ for the __SelectionOnFocus__ property.
79+
## Clear Selection On Delete Or Back Key
7880

79-
* __Default__: Once the control is focused, the cursor will be positioned at its end.
81+
The RadMultiColumnComboBox control provides the ability to control if the selected item/s will be removed when pressing the Delete or Back key when typing into the input box. This is done via the `ClearSelectionOnDeleteOrBackKey` property and its default value is __True__. Setting it to __False__ will prevent the removal of selected items when pressing the into the input box
8082

81-
* __DefaultSelectAll__: This property changes the __SelectionOnFocus__ behavior of the control depending on the source of the focus. If the control is focused on mouse click, the __Default SelectionOnFocus__ behavior will be used. If, on the other hand, the control is focused using the __Tab__ key, the __SelectAll SelectionOnFocus__ behavior will be used.
83+
__Setting the ClearSelectionOnDeleteOrBackKey property__
84+
```XAML
85+
<telerik:RadMultiColumnComboBox ClearSelectionOnDeleteOrBackKey="False"/>
86+
```
8287

8388
## See Also
8489

0 commit comments

Comments
 (0)