Address:" & entry.Address & " Phone:" & entry.PhoneNumber + ""
-If item.Children.Count > 0 Then
- Dim checkBoxItem As ListViewItemCheckbox = TryCast(item.Children(0), ListViewItemCheckbox)
- checkBoxItem.Margin = New Padding(2)
-End If
-
-````
-
-{{endregion}}
-
+
+

diff --git a/controls/clock/customizing-appearance/accessing-and-customizing-elements.md b/controls/clock/customizing-appearance/accessing-and-customizing-elements.md
index 2bd7331e3..afb8c930b 100644
--- a/controls/clock/customizing-appearance/accessing-and-customizing-elements.md
+++ b/controls/clock/customizing-appearance/accessing-and-customizing-elements.md
@@ -32,17 +32,8 @@ You can customize the nested elements at run time as well:
#### Customize elements
-{{source=..\SamplesCS\Clock\ClockGettingStarted.cs region=AccessingCustomizingElements}}
-{{source=..\SamplesVB\Clock\ClockGettingStarted.vb region=AccessingCustomizingElements}}
+
+
-````C#
-radClock1.ClockElement.SecondsArrow.Image = Properties.Resources.telerikLogo1;
-
-````
-````VB.NET
-radClock1.ClockElement.SecondsArrow.Image = My.Resources.telerikLogo1
-
-````
-
-{{endregion}}
+
diff --git a/controls/clock/getting-started.md b/controls/clock/getting-started.md
index e6dfd4b2f..b7d25be81 100644
--- a/controls/clock/getting-started.md
+++ b/controls/clock/getting-started.md
@@ -40,21 +40,10 @@ The Telerik UI for WinForms assemblies can be install by using one of the availa
#### Adding a RadClock at runtime
-{{source=..\SamplesCS\Clock\ClockGettingStarted.cs region=CreatingControl}}
-{{source=..\SamplesVB\Clock\ClockGettingStarted.vb region=CreatingControl}}
+
+
-````C#
-RadClock clock = new RadClock();
-this.Controls.Add(clock);
-
-````
-````VB.NET
-Dim clock As New RadClock()
-Me.Controls.Add(clock)
-
-````
-
-{{endregion}}
+
The control has three important properties:
@@ -74,25 +63,10 @@ Now let's create a simple application.
3\. In the code behind, set the __ShowSystemTime__ property of the first clock (assuming that your system time show the time in Sofia).
4\. For the rest of the clocks, set their __Offset__ properties to: *-2*, *-6*, *+7*:
-{{source=..\SamplesCS\Clock\ClockGettingStarted.cs region=gettingStarted}}
-{{source=..\SamplesVB\Clock\ClockGettingStarted.vb region=gettingStarted}}
-
-````C#
-sofiaClock.ShowSystemTime = true;
-londonClock.Offset = new TimeSpan(-2, 0, 0);
-newYorkClock.Offset = new TimeSpan(-6, 0, 0);
-tokyoClock.Offset = new TimeSpan(7, 0, 0);
-
-````
-````VB.NET
-sofiaClock.ShowSystemTime = True
-londonClock.Offset = New TimeSpan(-2, 0, 0)
-newYorkClock.Offset = New TimeSpan(7, 0, 0)
-tokyoClock.Offset = New TimeSpan(-6, 0, 0)
-
-````
+
+
-{{endregion}}
+
Here is the result:
diff --git a/controls/clock/tooltips.md b/controls/clock/tooltips.md
index 7c00c6bb9..56860e109 100644
--- a/controls/clock/tooltips.md
+++ b/controls/clock/tooltips.md
@@ -14,42 +14,19 @@ There are two ways to assign tooltips to __RadClock__, namely setting the __Tool
#### Setting the ToolTipText property
-{{source=..\SamplesCS\Clock\ClockGettingStarted.cs region=SetToolTipText}}
-{{source=..\SamplesVB\Clock\ClockGettingStarted.vb region=SetToolTipText}}
+
+
-````C#
-radClock1.ClockElement.ToolTipText = DateTime.Now.ToLongTimeString();
-
-````
-````VB.NET
-radClock1.ClockElement.ToolTipText = DateTime.Now.ToLongTimeString()
-
-````
-
-{{endregion}}
+

#### Setting tool tips in the ToolTipTextNeeded event
-{{source=..\SamplesCS\Clock\ClockGettingStarted.cs region=ToolTipTextNeeded}}
-{{source=..\SamplesVB\Clock\ClockGettingStarted.vb region=ToolTipTextNeeded}}
+
+
-````C#
-private void RadClock1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)
-{
- e.ToolTipText = DateTime.Now.ToLongTimeString();
-}
-
-````
-````VB.NET
-Private Sub RadClock1_ToolTipTextNeeded(sender As Object, e As Telerik.WinControls.ToolTipTextNeededEventArgs)
- e.ToolTipText = DateTime.Now.ToLongTimeString()
-End Sub
-
-````
-
-{{endregion}}
+

diff --git a/controls/commandbar/customizing-appearance/accessing-and-customizing-elements.md b/controls/commandbar/customizing-appearance/accessing-and-customizing-elements.md
index 708718659..e11d4944e 100644
--- a/controls/commandbar/customizing-appearance/accessing-and-customizing-elements.md
+++ b/controls/commandbar/customizing-appearance/accessing-and-customizing-elements.md
@@ -25,25 +25,9 @@ You can customize the elements at run time as well:
#### Customize elements at run time
-{{source=..\SamplesCS\CommandBar\FloatingStrips.cs region=AccessingCustomizingElements}}
-{{source=..\SamplesVB\CommandBar\FloatingStrips.vb region=AccessingCustomizingElements}}
-
-````C#
-this.radCommandBar1.Rows[0].BackColor = Color.Lime;
-this.radCommandBar1.Rows[0].DrawFill = true;
-this.radCommandBar1.Rows[0].GradientStyle = Telerik.WinControls.GradientStyles.Solid;
-this.radCommandBar1.Rows[0].Strips[0].BackColor = Color.Yellow;
-this.radCommandBar1.Rows[0].Strips[0].BorderColor = Color.Red;
-
-````
-````VB.NET
-Me.RadCommandBar1.Rows(0).BackColor = Color.Lime
-Me.RadCommandBar1.Rows(0).DrawFill = True
-Me.RadCommandBar1.Rows(0).GradientStyle = Telerik.WinControls.GradientStyles.Solid
-Me.RadCommandBar1.Rows(0).Strips(0).BackColor = Color.Yellow
-Me.RadCommandBar1.Rows(0).Strips(0).BorderColor = Color.Red
-
-````
-
-{{endregion}}
+
+
+
+
+
diff --git a/controls/commandbar/floating-strips.md b/controls/commandbar/floating-strips.md
index c29bc6538..8b8e31165 100644
--- a/controls/commandbar/floating-strips.md
+++ b/controls/commandbar/floating-strips.md
@@ -29,113 +29,38 @@ There are some events that provide you with control over the floating/docking pr
* __FloatingStripCreating__ event is fired when a strip is about to be made floating. The following example shows how to prevent the strip “OptionsStrip” from becoming floating.
-{{source=..\SamplesCS\CommandBar\FloatingStrips.cs region=floatingStripCreating}}
-{{source=..\SamplesVB\CommandBar\FloatingStrips.vb region=floatingStripCreating}}
-
-````C#
-
-void radCommandBar1_FloatingStripCreating(object sender, CancelEventArgs e)
-{
- if ((sender as CommandBarStripElement).Name == "OptionsStrip")
- {
- e.Cancel = true;
- }
-}
-
-````
-````VB.NET
-Private Sub radCommandBar1_FloatingStripCreating(ByVal sender As Object, ByVal e As CancelEventArgs)
- If TryCast(sender, CommandBarStripElement).Name = "OptionsStrip" Then
- e.Cancel = True
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
* __FloatingStripCreated__ event is fired when the floating form is shown.
The following example shows how to set the caption text of the floating form:
-{{source=..\SamplesCS\CommandBar\FloatingStrips.cs region=floatingStripCreated}}
-{{source=..\SamplesVB\CommandBar\FloatingStrips.vb region=floatingStripCreated}}
-
-````C#
-void radCommandBar1_FloatingStripCreated(object sender, EventArgs e)
-{
- (sender as CommandBarStripElement).FloatingForm.Text = "Just a floating form";
-}
-
-````
-````VB.NET
-Private Sub radCommandBar1_FloatingStripCreated(ByVal sender As Object, ByVal e As EventArgs)
- TryCast(sender, CommandBarStripElement).FloatingForm.Text = "Just a floating form"
-End Sub
-
-````
+
+
-{{endregion}}
+
* __FloatingStripDocking__ event is fired when a floating strip is about to be docked to a __RadCommandBar__ control.
The following example shows how to prevent the strip with name “OptionsStrip” from being docked.
-{{source=..\SamplesCS\CommandBar\FloatingStrips.cs region=floatingStripDocking}}
-{{source=..\SamplesVB\CommandBar\FloatingStrips.vb region=floatingStripDocking}}
-
-````C#
-void radCommandBar1_FloatingStripDocking(object sender, CancelEventArgs e)
-{
- if ((sender as CommandBarStripElement).Name == "OptionsStrip")
- {
- e.Cancel = true;
- }
-}
-
-````
-````VB.NET
-Private Sub radCommandBar1_FloatingStripDocking(ByVal sender As Object, ByVal e As CancelEventArgs)
- If TryCast(sender, CommandBarStripElement).Name = "OptionsStrip" Then
- e.Cancel = True
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
* __FloatingStripDocked__ event is fired when a floating strip has docked to a __RadCommandBar__ control.
The following example shows a sample usage of this event.
-{{source=..\SamplesCS\CommandBar\FloatingStrips.cs region=floatingStripDocked}}
-{{source=..\SamplesVB\CommandBar\FloatingStrips.vb region=floatingStripDocked}}
-
-````C#
-
-void radCommandBar1_FloatingStripDocked(object sender, EventArgs e)
-{
- CommandBarStripElement dockedStrip = sender as CommandBarStripElement;
- if (dockedStrip != null)
- {
- MessageBox.Show(dockedStrip.Name + " has docked to " + dockedStrip.ElementTree.Control.Name);
- }
-}
-
-````
-````VB.NET
-Private Sub radCommandBar1_FloatingStripDocked(ByVal sender As Object, ByVal e As EventArgs)
- Dim dockedStrip As CommandBarStripElement = TryCast(sender, CommandBarStripElement)
- If dockedStrip IsNot Nothing Then
- MessageBox.Show(dockedStrip.Name & " has docked to " & dockedStrip.ElementTree.Control.Name)
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
diff --git a/controls/commandbar/getting-started.md b/controls/commandbar/getting-started.md
index 34ceaeac7..d8b1e62cf 100644
--- a/controls/commandbar/getting-started.md
+++ b/controls/commandbar/getting-started.md
@@ -49,36 +49,10 @@ To programmatically add a __RadCommandBar__ to a form, create a new instance of
#### Adding a RadCommandBar at runtime
-{{source=..\SamplesCS\CommandBar\FloatingStrips.cs region=CreatingControl}}
-{{source=..\SamplesVB\CommandBar\FloatingStrips.vb region=CreatingControl}}
-
-````C#
-
-RadCommandBar radCommandBar = new RadCommandBar();
-this.Controls.Add(radCommandBar);
-radCommandBar.Dock = DockStyle.Top;
-CommandBarRowElement row1 = new CommandBarRowElement();
-radCommandBar.Rows.Add(row1);
-CommandBarStripElement strip1 = new CommandBarStripElement();
-row1.Strips.Add(strip1);
-CommandBarButton button1 = new CommandBarButton();
-strip1.Items.Add(button1);
-
-````
-````VB.NET
-Dim radCommandBar As New RadCommandBar()
-Me.Controls.Add(radCommandBar)
-radCommandBar.Dock = DockStyle.Top
-Dim row1 As New CommandBarRowElement()
-radCommandBar.Rows.Add(row1)
-Dim strip1 As New CommandBarStripElement()
-row1.Strips.Add(strip1)
-Dim button1 As New CommandBarButton()
-strip1.Items.Add(button1)
-
-````
-
-{{endregion}}
+
+
+
+
## Telerik UI for WinForms Learning Resources
* [Telerik UI for WinForms CommandBar Component](https://www.telerik.com/products/winforms/commandbar.aspx)
diff --git a/controls/commandbar/how-to/customize-the-control-context-menu.md b/controls/commandbar/how-to/customize-the-control-context-menu.md
index 1a8fc53c3..b3b3022cc 100644
--- a/controls/commandbar/how-to/customize-the-control-context-menu.md
+++ b/controls/commandbar/how-to/customize-the-control-context-menu.md
@@ -13,56 +13,16 @@ previous_url: commandbar-howto-customize-the-control-context-menu
When the __RadCommandBar__ control is right clicked, a context menu enlisting the strips in the control together with __Customize__ menu option (allowing to customize the strips) is being shown. This context menu is being populated by the time of its opening and in order to customize its items, you should do that from within the __DropDownOpening__ event of this context menu. Here is how to subscribe to this event and how add your custom item and how to remove the __Customize__ option:
-{{source=..\SamplesCS\CommandBar\SaveAndLoadLayout1.cs region=subscribeToContextMenuOpening}}
-{{source=..\SamplesVB\CommandBar\SaveAndLoadLayout.vb region=subscribeToContextMenuOpening}}
-````C#
-radCommandBar1.CustomizeContextMenu.DropDownOpening += new CancelEventHandler(CustomizeContextMenu_DropDownOpening);
+
+
-````
-````VB.NET
-AddHandler RadCommandBar1.CustomizeContextMenu.DropDownOpening, AddressOf CustomizeContextMenu_DropDownOpening
-````
-{{endregion}}
+
+
-{{source=..\SamplesCS\CommandBar\SaveAndLoadLayout1.cs region=CustomizeTheContextMenu}}
-{{source=..\SamplesVB\CommandBar\SaveAndLoadLayout.vb region=CustomizeTheContextMenu}}
-
-````C#
-void CustomizeContextMenu_DropDownOpening(object sender, CancelEventArgs e)
-{
- //add custom item
- RadMenuItem myItem = new RadMenuItem("MyItem");
- radCommandBar1.CustomizeContextMenu.Items.Add(myItem);
- //remove the customize menu option
- for (int i = 0; i < radCommandBar1.CustomizeContextMenu.Items.Count; i++)
- {
- if ( radCommandBar1.CustomizeContextMenu.Items[i].Text == "Customize...")
- {
- radCommandBar1.CustomizeContextMenu.Items.RemoveAt(i);
- }
- }
-}
-
-````
-````VB.NET
-Private Sub CustomizeContextMenu_DropDownOpening(sender As Object, e As System.ComponentModel.CancelEventArgs)
- 'add custom item
- Dim myItem As New RadMenuItem("MyItem")
- RadCommandBar1.CustomizeContextMenu.Items.Add(myItem)
- 'remove the customize menu option
- For i As Integer = 0 To RadCommandBar1.CustomizeContextMenu.Items.Count - 1
- If RadCommandBar1.CustomizeContextMenu.Items(i).Text = "Customize..." Then
- RadCommandBar1.CustomizeContextMenu.Items.RemoveAt(i)
- End If
- Next
-End Sub
-
-````
-
-{{endregion}}
+
>caption Figure 1: CustomizeContextMenu
>
diff --git a/controls/commandbar/how-to/customize-the-overflow-button.md b/controls/commandbar/how-to/customize-the-overflow-button.md
index cc9d0696e..8458e4c53 100644
--- a/controls/commandbar/how-to/customize-the-overflow-button.md
+++ b/controls/commandbar/how-to/customize-the-overflow-button.md
@@ -21,41 +21,10 @@ Each [CommandBarStripElement]({%slug winforms/commandbar/structure%}) has its ow
The following example, demonstrates how to access the __RadMenuItems__ of the __Overflow__ button. For your convenience we have exposed the __CustomizeButtonMenuItem__ and the __AddRemoveButtonsMenuItem__.
-{{source=..\SamplesCS\CommandBar\SaveAndLoadLayout1.cs region=HideMenuItems}}
-{{source=..\SamplesVB\CommandBar\SaveAndLoadLayout.vb region=HideMenuItems}}
+
+
-````C#
-//Change the font of the AddRemoveButtonMenuItem
-radCommandBarStripElement1.OverflowButton.AddRemoveButtonsMenuItem.Font = new System.Drawing.Font("Arial", 12f);
-//Change the font of the CustomizeButtonMenuItem
-radCommandBarStripElement1.OverflowButton.CustomizeButtonMenuItem.Font = new System.Drawing.Font("Segoe UI", 10f, FontStyle.Bold);
-//hide the separators
-foreach (var item in radCommandBarStripElement1.OverflowButton.DropDownMenu.Items)
-{
- RadMenuSeparatorItem separator = item as RadMenuSeparatorItem;
- if (separator != null)
- {
- separator.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
- }
-}
-
-````
-````VB.NET
-'Change the font of the AddRemoveButtonMenuItem
-CommandBarStripElement1.OverflowButton.AddRemoveButtonsMenuItem.Font = New System.Drawing.Font("Arial", 12.0F)
-'Change the font of the CustomizeButtonMenuItem
-CommandBarStripElement1.OverflowButton.CustomizeButtonMenuItem.Font = New System.Drawing.Font("Segoe UI", 10.0F, FontStyle.Bold)
-'hide the separators
-For Each item In CommandBarStripElement1.OverflowButton.DropDownMenu.Items
- Dim separator As RadMenuSeparatorItem = TryCast(item, RadMenuSeparatorItem)
- If separator IsNot Nothing Then
- separator.Visibility = Telerik.WinControls.ElementVisibility.Collapsed
- End If
-Next
-
-````
-
-{{endregion}}
+

@@ -63,19 +32,10 @@ Next
Alternatively, if you need to hide the whole __Overflow__ button, simply set its Visibility property to *Collapsed*
-{{source=..\SamplesCS\CommandBar\SaveAndLoadLayout1.cs region=HideTheOverFlowButton}}
-{{source=..\SamplesVB\CommandBar\SaveAndLoadLayout.vb region=HideTheOverFlowButton}}
+
+
-````C#
-radCommandBarStripElement1.OverflowButton.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
-
-````
-````VB.NET
-CommandBarStripElement1.OverflowButton.Visibility = Telerik.WinControls.ElementVisibility.Collapsed
-
-````
-
-{{endregion}}
+

diff --git a/controls/commandbar/how-to/prevent-the-control-from-gaining-focus.md b/controls/commandbar/how-to/prevent-the-control-from-gaining-focus.md
index 96011bd48..4b5c842b3 100644
--- a/controls/commandbar/how-to/prevent-the-control-from-gaining-focus.md
+++ b/controls/commandbar/how-to/prevent-the-control-from-gaining-focus.md
@@ -21,44 +21,10 @@ Currently, __RadCommandBar__ receives the focus. One can easily override this be
1. Override the ProcessFocusRequested method and return false.
-{{source=..\SamplesCS\CommandBar\HowTo\MakeRadCommandBarUnfocusable.cs region=ForbidFocus}}
-{{source=..\SamplesVB\CommandBar\HowTo\MakeRadCommandBarUnfocusable.vb region=ForbidFocus}}
+
+
-````C#
-class MyCommandBar : RadCommandBar
-{
- public override string ThemeClassName
- {
- get
- {
- return typeof(RadCommandBar).FullName;
- }
- }
- protected override bool ProcessFocusRequested(RadElement element)
- {
- return false;
- }
-}
-
-````
-````VB.NET
-Class MyCommandBar
- Inherits RadCommandBar
- Public Overrides Property ThemeClassName() As String
- Get
- Return GetType(RadButton).FullName
- End Get
- Set(ByVal value As String)
- End Set
- End Property
- Protected Overrides Function ProcessFocusRequested(element As RadElement) As Boolean
- Return False
- End Function
-End Class
-
-````
-
-{{endregion}}
+
diff --git a/controls/commandbar/localization/localization.md b/controls/commandbar/localization/localization.md
index 9c98cb1b7..cc7496728 100644
--- a/controls/commandbar/localization/localization.md
+++ b/controls/commandbar/localization/localization.md
@@ -25,78 +25,20 @@ To localize RadCommandBar to display control text and messages in a specific lan
Below is a sample implementation of an English localization provider:
-{{source=..\SamplesCS\CommandBar\MyEnglishCommandBarLocalizationProvider.cs region=provider}}
-{{source=..\SamplesVB\CommandBar\MyEnglishCommandBarLocalizationProvider.vb region=provider}}
+
+
-````C#
-public class MyEnglishCommandBarLocalizationProvider : CommandBarLocalizationProvider
-{
- public override string GetLocalizedString(string id)
- {
- switch (id)
- {
- case CommandBarStringId.CustomizeDialogChooseToolstripLabelText: return "Choose a toolstrip to rearrange:";
- case CommandBarStringId.CustomizeDialogCloseButtonText: return "Close";
- case CommandBarStringId.CustomizeDialogItemsPageTitle: return "Items";
- case CommandBarStringId.CustomizeDialogMoveDownButtonText: return "Move Down";
- case CommandBarStringId.CustomizeDialogMoveUpButtonText: return "Move Up";
- case CommandBarStringId.CustomizeDialogResetButtonText: return "Reset";
- case CommandBarStringId.CustomizeDialogTitle: return "Customize1";
- case CommandBarStringId.CustomizeDialogToolstripsPageTitle: return "Toolstrips";
- case CommandBarStringId.OverflowMenuAddOrRemoveButtonsText: return "Add or Remove Buttons";
- case CommandBarStringId.OverflowMenuCustomizeText: return "Customize...";
- case CommandBarStringId.ContextMenuCustomizeText: return "Customize...";
- default: return base.GetLocalizedString(id);
- }
- }
-}
-
-````
-````VB.NET
-Public Class MyEnglishCommandBarLocalizationProvider
- Inherits CommandBarLocalizationProvider
- Public Overrides Function GetLocalizedString(ByVal id As String) As String
- Select Case id
- Case CommandBarStringId.CustomizeDialogChooseToolstripLabelText : Return "Choose a toolstrip to rearrange:"
- Case CommandBarStringId.CustomizeDialogCloseButtonText : Return "Close"
- Case CommandBarStringId.CustomizeDialogItemsPageTitle : Return "Items"
- Case CommandBarStringId.CustomizeDialogMoveDownButtonText : Return "Move Down"
- Case CommandBarStringId.CustomizeDialogMoveUpButtonText : Return "Move Up"
- Case CommandBarStringId.CustomizeDialogResetButtonText : Return "Reset"
- Case CommandBarStringId.CustomizeDialogTitle : Return "Customize1"
- Case CommandBarStringId.CustomizeDialogToolstripsPageTitle : Return "Toolstrips"
- Case CommandBarStringId.OverflowMenuAddOrRemoveButtonsText : Return "Add or Remove Buttons"
- Case CommandBarStringId.OverflowMenuCustomizeText : Return "Customize..."
- Case CommandBarStringId.ContextMenuCustomizeText : Return "Customize..."
- Case Else : Return MyBase.GetLocalizedString(id)
- End Select
- Return String.Empty
- End Function
-End Class
-
-````
-
-{{endregion}}
+
To apply the custom localization provider, instantiate and assign it to the current localization provider:
#### Assigning the Current Localization Provider
-{{source=..\SamplesCS\CommandBar\FloatingStrips.cs region=usingProvider}}
-{{source=..\SamplesVB\CommandBar\FloatingStrips.vb region=usingProvider}}
+
+
-````C#
-
-CommandBarLocalizationProvider.CurrentProvider = new MyEnglishCommandBarLocalizationProvider();
-
-````
-````VB.NET
-CommandBarLocalizationProvider.CurrentProvider = New MyEnglishCommandBarLocalizationProvider()
-
-````
-
-{{endregion}}
+
The code provided above illustrates the approach to be used to localize the __RadCommandBar__ and is not intended as a full translation.
diff --git a/controls/commandbar/localization/right-to-left-support.md b/controls/commandbar/localization/right-to-left-support.md
index 0889625b0..a48ef9afd 100644
--- a/controls/commandbar/localization/right-to-left-support.md
+++ b/controls/commandbar/localization/right-to-left-support.md
@@ -17,20 +17,10 @@ previous_url: commandbar-localization-rtl
You can present the content of your commandbar instance in a right-to-left direction by setting the __RightToLeft__ property to *Yes*:
-{{source=..\SamplesCS\CommandBar\FloatingStrips.cs region=rtl}}
-{{source=..\SamplesVB\CommandBar\FloatingStrips.vb region=rtl}}
+
+
-````C#
-
-this.radCommandBar1.RightToLeft = RightToLeft.Yes;
-
-````
-````VB.NET
-Me.RadCommandBar1.RightToLeft = Windows.Forms.RightToLeft.Yes
-
-````
-
-{{endregion}}
+

diff --git a/controls/commandbar/save-and-load-layout.md b/controls/commandbar/save-and-load-layout.md
index b5952a667..dfd43d1e7 100644
--- a/controls/commandbar/save-and-load-layout.md
+++ b/controls/commandbar/save-and-load-layout.md
@@ -21,79 +21,19 @@ Initially the layout looks like this:

-{{source=..\SamplesCS\CommandBar\SaveAndLoadLayout1.cs region=saveLayout}}
-{{source=..\SamplesVB\CommandBar\SaveAndLoadLayout.vb region=saveLayout}}
-
-````C#
-private void radButton1_Click(object sender, EventArgs e)
-{
- string s = "default.xml";
- SaveFileDialog dialog = new SaveFileDialog();
- dialog.Filter =
- "xml files (*.xml)|*.xml|All files (*.*)|*.*";
- dialog.Title = "Select a xml file";
- if (dialog.ShowDialog() == DialogResult.OK)
- {
- s = dialog.FileName;
- }
- this.radCommandBar1.CommandBarElement.SaveLayout(s);
-}
-
-````
-````VB.NET
-Private Sub RadButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadButton1.Click
- Dim s As String = "default.xml"
- Dim dialog As New SaveFileDialog()
- dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*"
- dialog.Title = "Select a xml file"
- If dialog.ShowDialog() = DialogResult.OK Then
- s = dialog.FileName
- End If
- Me.RadCommandBar1.CommandBarElement.SaveLayout(s)
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
Now we are going to set some of the items __VisibleInStrip__ properties to *false*
The code snippets below demonstrate how you can implement a *Load Layout* button event handler:
-{{source=..\SamplesCS\CommandBar\SaveAndLoadLayout1.cs region=loadLayout}}
-{{source=..\SamplesVB\CommandBar\SaveAndLoadLayout.vb region=loadLayout}}
-
-````C#
-private void radButton2_Click(object sender, EventArgs e)
-{
- string s = "default.xml";
- OpenFileDialog dialog = new OpenFileDialog();
- dialog.Filter =
- "xml files (*.xml)|*.xml|All files (*.*)|*.*";
- dialog.Title = "Select a xml file";
- if (dialog.ShowDialog() == DialogResult.OK)
- {
- s = dialog.FileName;
- }
- this.radCommandBar1.CommandBarElement.LoadLayout(s);
-}
-
-````
-````VB.NET
-Private Sub RadButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadButton2.Click
- Dim s As String = "default.xml"
- Dim dialog As New OpenFileDialog()
- dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*"
- dialog.Title = "Select a xml file"
- If dialog.ShowDialog() = DialogResult.OK Then
- s = dialog.FileName
- End If
- Me.RadCommandBar1.CommandBarElement.LoadLayout(s)
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
After loading the layout it will reload the initial settings of the existing items:
@@ -104,29 +44,10 @@ __Sample save/load scenario__
The following example demonstrates how you can save the layout settings of a __RadCommandBar__ when the parent form of this command bar is closed and how you can load these settings when the form is reopened. Basically, you need to handle the __Load__ and __FormClosing__ events of the form.
-{{source=..\SamplesCS\CommandBar\SaveAndLoadLayout1.cs region=autoLoadLayoutOnFormLoad}}
-{{source=..\SamplesVB\CommandBar\SaveAndLoadLayout.vb region=autoLoadLayoutOnFormLoad}}
-
-````C#
-private void SaveAndLoadLayout1_Load(object sender, EventArgs e)
-{
- if (File.Exists("MyLayout.xml"))
- {
- this.radCommandBar1.CommandBarElement.LoadLayout("MyLayout.xml");
- }
-}
-
-````
-````VB.NET
-Private Sub SaveAndLoadLayout_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- If File.Exists("MyLayout.xml") Then
- Me.RadCommandBar1.CommandBarElement.LoadLayout("MyLayout.xml")
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
diff --git a/controls/dataentry/customizing-appearance/customizing-appearance.md b/controls/dataentry/customizing-appearance/customizing-appearance.md
index 0e8b57064..1b74a37f0 100644
--- a/controls/dataentry/customizing-appearance/customizing-appearance.md
+++ b/controls/dataentry/customizing-appearance/customizing-appearance.md
@@ -26,18 +26,10 @@ The following snippet show how you can customize the RadDataEntry styles at runt
#### Change Border Color
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryHowTo.cs region=SetBorderColor}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryHowTo.vb region=SetBorderColor}}
-````C#
-radDataEntry1.DataEntryElement.Border.ForeColor = ColorTranslator.FromHtml("#e83737");
+
+
-````
-````VB.NET
-radDataEntry1.DataEntryElement.Border.ForeColor = ColorTranslator.FromHtml("#e83737")
-````
-
-{{endregion}}
>caption Figure 2: The changed border.
@@ -49,34 +41,10 @@ The following snippet shows how you access the underlying controls and change th
#### Set Labels ForeColor
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryHowTo.cs region=LabelColor}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryHowTo.vb region=LabelColor}}
-````C#
-foreach (RadPanel item in radDataEntry1.PanelContainer.Controls)
-{
- foreach (RadControl control in item.Controls)
- {
- if (control is RadLabel)
- {
- control.ForeColor = ColorTranslator.FromHtml("#e83737");
- }
- }
-}
-
-````
-````VB.NET
-For Each item As RadPanel In radDataEntry1.PanelContainer.Controls
- For Each control As RadControl In item.Controls
- If TypeOf control Is RadLabel Then
- control.ForeColor = ColorTranslator.FromHtml("#e83737")
- End If
- Next control
-Next item
-
-````
-
-
-{{endregion}}
+
+
+
+
>caption Figure 3: Set Labels ForeColor.
@@ -88,18 +56,10 @@ The following code snippets represent how to change the BackColor property of Va
### Change Back Color
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryHowTo.cs region=ChangeBackColor}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryHowTo.vb region=ChangeBackColor}}
-````C#
-this.radDataEntry1.ValidationPanel.PanelElement.Fill.BackColor = Color.PapayaWhip;
-
-````
-````VB.NET
-Me.radDataEntry1.ValidationPanel.PanelElement.Fill.BackColor = Color.PapayaWhip
+
+
-````
-{{endregion}}
>caption Figure 4: Set Validaton Panel BackColor.
diff --git a/controls/dataentry/getting-started.md b/controls/dataentry/getting-started.md
index ed4dd7082..c603ec88d 100644
--- a/controls/dataentry/getting-started.md
+++ b/controls/dataentry/getting-started.md
@@ -43,162 +43,18 @@ The Telerik UI for WinForms assemblies can be install by using one of the availa
2\. For the purpose of this tutorial, we will create a new class Employee with a couple of exposed properties
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.cs region=empl1}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.vb region=empl1}}
-
-````C#
-private class Employee
-{
- public string FirstName
- {
- get;
- set;
- }
- public string LastName
- {
- get;
- set;
- }
- public string Occupation
- {
- get;
- set;
- }
- public DateTime StartingDate
- {
- get;
- set;
- }
- public bool IsMarried
- {
- get;
- set;
- }
- public int Salary
- {
- get;
- set;
- }
- public Gender Gender
- {
- get;
- set;
- }
-}
-private enum Gender
-{
- Female,
- Male
-}
-
-````
-````VB.NET
-Private Class Employee
- Public Property FirstName() As String
- Get
- Return m_FirstName
- End Get
- Set(value As String)
- m_FirstName = Value
- End Set
- End Property
- Private m_FirstName As String
- Public Property LastName() As String
- Get
- Return m_LastName
- End Get
- Set(value As String)
- m_LastName = Value
- End Set
- End Property
- Private m_LastName As String
- Public Property Occupation() As String
- Get
- Return m_Occupation
- End Get
- Set(value As String)
- m_Occupation = Value
- End Set
- End Property
- Private m_Occupation As String
- Public Property StartingDate() As DateTime
- Get
- Return m_StartingDate
- End Get
- Set(value As DateTime)
- m_StartingDate = Value
- End Set
- End Property
- Private m_StartingDate As DateTime
- Public Property IsMarried() As Boolean
- Get
- Return m_IsMarried
- End Get
- Set(value As Boolean)
- m_IsMarried = Value
- End Set
- End Property
- Private m_IsMarried As Boolean
- Public Property Salary() As Integer
- Get
- Return m_Salary
- End Get
- Set(value As Integer)
- m_Salary = Value
- End Set
- End Property
- Private m_Salary As Integer
- Public Property Gender() As Gender
- Get
- Return m_Gender
- End Get
- Set(value As Gender)
- m_Gender = Value
- End Set
- End Property
- Private m_Gender As Gender
-End Class
-Private Enum Gender
- Female
- Male
-End Enum
-
-````
-
-{{endregion}}
+
+
+
+
3\. Once the class Employee is defined, you may use it for creating an object of this type and bind it to the RadDataEntry control:
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.cs region=bind1}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.vb region=bind1}}
-
-````C#
-this.radDataEntry1.DataSource = new Employee()
-{
- FirstName = "Sarah",
- LastName = "Blake",
- Occupation = "Supplied Manager",
- StartingDate = new DateTime(2005, 04, 12),
- IsMarried = true,
- Salary = 3500, Gender = Gender.Female
-};
-
-````
-````VB.NET
-Me.radDataEntry1.DataSource = New Employee() With { _
- .FirstName = "Sarah", _
- .LastName = "Blake", _
- .Occupation = "Supplied Manager", _
- .StartingDate = New DateTime(2005, 4, 12), _
- .IsMarried = True, _
- .Salary = 3500, _
- .Gender = Gender.Female _
- }
-
-````
-
-{{endregion}}
+
+
+
+
4\. Press F5 to run the project and you should see the following:
@@ -218,80 +74,18 @@ The following tutorial will demonstrate how to bind __RadDataEntry__ to a collec
2\. Create List of business objects and set it as data source of BindingSource.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryGettingStarted2.cs region=bind2}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryGettingStarted2.vb region=bind2}}
-
-````C#
-List employees = new List();
-employees.Add(new Employee() { FirstName = "Sarah", LastName = "Blake", Occupation = "Supplied Manager", StartingDate = new DateTime(2005, 04, 12), IsMarried = true, Salary = 3500, Gender = Gender.Female });
-employees.Add(new Employee() { FirstName = "Jane", LastName = "Simpson", Occupation = "Security", StartingDate = new DateTime(2008, 12, 03), IsMarried = true, Salary = 2000, Gender = Gender.Female });
-employees.Add(new Employee() { FirstName = "John", LastName = "Peterson", Occupation = "Consultant", StartingDate = new DateTime(2005, 04, 12), IsMarried = false, Salary = 2600, Gender = Gender.Male });
-employees.Add(new Employee() { FirstName = "Peter", LastName = "Bush", Occupation = "Cashier", StartingDate = new DateTime(2005, 04, 12), IsMarried = true, Salary = 2300, Gender = Gender.Male });
-this.bindingSource1.DataSource = employees;
-
-````
-````VB.NET
-Dim employees As New List(Of Employee)()
-employees.Add(New Employee() With { _
- .FirstName = "Sarah", _
- .LastName = "Blake", _
- .Occupation = "Supplied Manager", _
- .StartingDate = New DateTime(2005, 4, 12), _
- .IsMarried = True, _
- .Salary = 3500, _
- .Gender = Gender.Female _
-})
-employees.Add(New Employee() With { _
- .FirstName = "Jane", _
- .LastName = "Simpson", _
- .Occupation = "Security", _
- .StartingDate = New DateTime(2008, 12, 3), _
- .IsMarried = True, _
- .Salary = 2000, _
- .Gender = Gender.Female _
-})
-employees.Add(New Employee() With { _
- .FirstName = "John", _
- .LastName = "Peterson", _
- .Occupation = "Consultant", _
- .StartingDate = New DateTime(2005, 4, 12), _
- .IsMarried = False, _
- .Salary = 2600, _
- .Gender = Gender.Male _
-})
-employees.Add(New Employee() With { _
- .FirstName = "Peter", _
- .LastName = "Bush", _
- .Occupation = "Cashier", _
- .StartingDate = New DateTime(2005, 4, 12), _
- .IsMarried = True, _
- .Salary = 2300, _
- .Gender = Gender.Male _
-})
-Me.bindingSource1.DataSource = employees
-
-````
-
-{{endregion}}
+
+
+
+
3\. Set this __BindingSource__ to __RadBindingNavigator__ and __RadDataEntry__.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryGettingStarted2.cs region=bind3}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryGettingStarted2.vb region=bind3}}
-
-````C#
-this.radDataEntry1.DataSource = this.bindingSource1;
-this.radBindingNavigator1.BindingSource = this.bindingSource1;
-
-````
-````VB.NET
-Me.radDataEntry1.DataSource = Me.bindingSource1
-Me.radBindingNavigator1.BindingSource = Me.bindingSource1
+
+
-````
-
-{{endregion}}
+
4\. Press __F5__ to run the project and you should see the following:
diff --git a/controls/dataentry/how-to/change-auto-generated-editor.md b/controls/dataentry/how-to/change-auto-generated-editor.md
index b3194fbfb..c842eec00 100644
--- a/controls/dataentry/how-to/change-auto-generated-editor.md
+++ b/controls/dataentry/how-to/change-auto-generated-editor.md
@@ -30,161 +30,17 @@ In the following example it will be demonstrated how to change default editor wi
#### Data Object
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.cs region=empl1}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.vb region=empl1}}
-
-````C#
-private class Employee
-{
- public string FirstName
- {
- get;
- set;
- }
- public string LastName
- {
- get;
- set;
- }
- public string Occupation
- {
- get;
- set;
- }
- public DateTime StartingDate
- {
- get;
- set;
- }
- public bool IsMarried
- {
- get;
- set;
- }
- public int Salary
- {
- get;
- set;
- }
- public Gender Gender
- {
- get;
- set;
- }
-}
-private enum Gender
-{
- Female,
- Male
-}
-
-````
-````VB.NET
-Private Class Employee
- Public Property FirstName() As String
- Get
- Return m_FirstName
- End Get
- Set(value As String)
- m_FirstName = Value
- End Set
- End Property
- Private m_FirstName As String
- Public Property LastName() As String
- Get
- Return m_LastName
- End Get
- Set(value As String)
- m_LastName = Value
- End Set
- End Property
- Private m_LastName As String
- Public Property Occupation() As String
- Get
- Return m_Occupation
- End Get
- Set(value As String)
- m_Occupation = Value
- End Set
- End Property
- Private m_Occupation As String
- Public Property StartingDate() As DateTime
- Get
- Return m_StartingDate
- End Get
- Set(value As DateTime)
- m_StartingDate = Value
- End Set
- End Property
- Private m_StartingDate As DateTime
- Public Property IsMarried() As Boolean
- Get
- Return m_IsMarried
- End Get
- Set(value As Boolean)
- m_IsMarried = Value
- End Set
- End Property
- Private m_IsMarried As Boolean
- Public Property Salary() As Integer
- Get
- Return m_Salary
- End Get
- Set(value As Integer)
- m_Salary = Value
- End Set
- End Property
- Private m_Salary As Integer
- Public Property Gender() As Gender
- Get
- Return m_Gender
- End Get
- Set(value As Gender)
- m_Gender = Value
- End Set
- End Property
- Private m_Gender As Gender
-End Class
-Private Enum Gender
- Female
- Male
-End Enum
-
-````
-
-{{endregion}}
+
+
+
+
#### Data Binding
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.cs region=bind1}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.vb region=bind1}}
-
-````C#
-this.radDataEntry1.DataSource = new Employee()
-{
- FirstName = "Sarah",
- LastName = "Blake",
- Occupation = "Supplied Manager",
- StartingDate = new DateTime(2005, 04, 12),
- IsMarried = true,
- Salary = 3500, Gender = Gender.Female
-};
-
-````
-````VB.NET
-Me.radDataEntry1.DataSource = New Employee() With { _
- .FirstName = "Sarah", _
- .LastName = "Blake", _
- .Occupation = "Supplied Manager", _
- .StartingDate = New DateTime(2005, 4, 12), _
- .IsMarried = True, _
- .Salary = 3500, _
- .Gender = Gender.Female _
- }
-
-````
-
-{{endregion}}
+
+
+
+
>caption Figure 1: RadDataEntry Initializing.
@@ -192,72 +48,19 @@ Me.radDataEntry1.DataSource = New Employee() With { _
2\. To change the default __RadTextBox__ editor of the “Salary” property with __RadMaskedEditBox__ we will subscribe to *EditorInitializing* event of __RadDataEntry__.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryHowTo.cs region=EditorInitializing}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryHowTo.vb region=EditorInitializing}}
-
-````C#
-void radDataEntry1_EditorInitializing(object sender, Telerik.WinControls.UI.EditorInitializingEventArgs e)
-{
- if (e.Property.Name == "Salary")
- {
- RadMaskedEditBox radMaskedEditBox = new RadMaskedEditBox();
- radMaskedEditBox.MaskType = MaskType.Numeric;
- radMaskedEditBox.MaskedEditBoxElement.StretchVertically = true;
- e.Editor = radMaskedEditBox;
- }
-}
-
-````
-````VB.NET
-Private Sub radDataEntry1_EditorInitializing(sender As Object, e As Telerik.WinControls.UI.EditorInitializingEventArgs)
- If e.[Property].Name = "Salary" Then
- Dim radMaskedEditBox As New RadMaskedEditBox()
- radMaskedEditBox.MaskType = MaskType.Numeric
- radMaskedEditBox.MaskedEditBoxElement.StretchVertically = True
- e.Editor = radMaskedEditBox
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
3\. To achieve working binding for this new editor we should subscribe to the *BindingCreated* event where we will subscribe to the *Parse* event of the Binding object. You can read more about *Format* and *Parse* events of Binding object and why we should use them [here](http://msdn.microsoft.com/en-us/library/system.windows.forms.binding_events%28v=vs.110%29.aspx).
#### Subscribe to Parse Event
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryHowTo.cs region=BindingCreated}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryHowTo.vb region=BindingCreated}}
-
-````C#
-void radDataEntry1_BindingCreated(object sender, BindingCreatedEventArgs e)
-{
- if (e.DataMember == "Salary")
- {
- e.Binding.Parse += new ConvertEventHandler(Binding_Parse);
- }
-}
-void Binding_Parse(object sender, ConvertEventArgs e)
-{
- int salary = int.Parse(e.Value.ToString(), NumberStyles.Currency);
- e.Value = salary;
-}
-
-````
-````VB.NET
-Private Sub radDataEntry1_BindingCreated(sender As Object, e As BindingCreatedEventArgs)
- If e.DataMember = "Salary" Then
- AddHandler e.Binding.Parse, AddressOf Binding_Parse
- End If
-End Sub
-Private Sub Binding_Parse(sender As Object, e As ConvertEventArgs)
- Dim salary As Integer = Integer.Parse(e.Value.ToString(), NumberStyles.Currency)
- e.Value = salary
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
>caption Figure 2: RadDataEntry MaskedEditBox.
@@ -267,35 +70,10 @@ End Sub
The spin editor is created with the default settings for __Minimum/Maximum, DecimalPlaces, and Step__. If a case, you are using fractional numbers, the decimal part will be lost so we need to change the above properties. You can do that in the __EditorInitializing__.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryHowTo.cs region=SpinEditorDefaultValues}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryHowTo.vb region=SpinEditorDefaultValues}}
-
-````C#
-void radDataEntry_EditorInitializing(object sender, EditorInitializingEventArgs e)
-{
- var spinEditor = e.Editor as RadSpinEditor;
-
- if (spinEditor == null)
- return;
-
- spinEditor.Step = 0.01m;
- spinEditor.DecimalPlaces = 2;
- spinEditor.Maximum = Decimal.MaxValue;
-}
-
-````
-````VB.NET
-Private Sub radDataEntry_EditorInitializing(ByVal sender As Object, ByVal e As EditorInitializingEventArgs)
- Dim spinEditor = TryCast(e.Editor, RadSpinEditor)
- If spinEditor Is Nothing Then Return
- spinEditor.[Step] = 0.01D
- spinEditor.DecimalPlaces = 2
- spinEditor.Maximum = Decimal.MaxValue
-End Sub
+
+
-````
-{{endregion}}
# See Also
diff --git a/controls/dataentry/how-to/change-the-editor-to-a-bound-raddropdownlist.md b/controls/dataentry/how-to/change-the-editor-to-a-bound-raddropdownlist.md
index 46297b569..9a128a68d 100644
--- a/controls/dataentry/how-to/change-the-editor-to-a-bound-raddropdownlist.md
+++ b/controls/dataentry/how-to/change-the-editor-to-a-bound-raddropdownlist.md
@@ -21,332 +21,57 @@ This article will walk you through the process of changing the default editor to
#### Subscribe to Events
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\DataEntryHowTo\ChangeEditorToDropDownList.cs region=subscribe}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\DataEntryHowTo\ChangeEditorToDropDownList.vb region=subscribe}}
+
+
-````C#
-radDataEntry1.EditorInitializing += radDataEntry1_EditorInitializing;
-radDataEntry1.BindingCreating += radDataEntry1_BindingCreating;
-radDataEntry1.BindingCreated += radDataEntry1_BindingCreated;
-
-radDataEntry1.DataSource = productsBinding;
-
-````
-````VB.NET
-AddHandler radDataEntry1.EditorInitializing, AddressOf radDataEntry1_EditorInitializing
-AddHandler radDataEntry1.BindingCreating, AddressOf radDataEntry1_BindingCreating
-AddHandler radDataEntry1.BindingCreated, AddressOf radDataEntry1_BindingCreated
-radDataEntry1.DataSource = productsBinding
-````
-
-{{endregion}}
2\. In the __EditorInitializing__ event handler, you will be able to change the automatically generated editor with RadDropDownList. In addition, you should set it up as needed. In this case we will set the __DataSource__, __DisplayMember__ and __ValueMenber__ properties.
#### Change Default Editor
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\DataEntryHowTo\ChangeEditorToDropDownList.cs region=editor}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\DataEntryHowTo\ChangeEditorToDropDownList.vb region=editor}}
-
-````C#
-RadDropDownList radDropDownList1;
-void radDataEntry1_EditorInitializing(object sender, Telerik.WinControls.UI.EditorInitializingEventArgs e)
-{
- if (e.Property.Name == "SupplierID")
- {
- radDropDownList1 = new RadDropDownList();
- radDropDownList1.DataSource = suplierList;
- radDropDownList1.ValueMember = "SupplierID";
- radDropDownList1.DisplayMember = "CompanyName";
- e.Editor = radDropDownList1;
- }
-}
-
-````
-````VB.NET
-Private radDropDownList1 As RadDropDownList
-Private Sub radDataEntry1_EditorInitializing(sender As Object, e As Telerik.WinControls.UI.EditorInitializingEventArgs)
- If e.[Property].Name = "SupplierID" Then
- radDropDownList1 = New RadDropDownList()
- radDropDownList1.DataSource = suplierList
- radDropDownList1.ValueMember = "SupplierID"
- radDropDownList1.DisplayMember = "CompanyName"
- e.Editor = radDropDownList1
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
-3\. In order the values to be synchronized correctly, the bound property should be set in the __BindingCreating__ event handler. In this case it should be set to the __SelectedValue__ property.
-#### Map Property
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\DataEntryHowTo\ChangeEditorToDropDownList.cs region=creating}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\DataEntryHowTo\ChangeEditorToDropDownList.vb region=creating}}
+3\. In order the values to be synchronized correctly, the bound property should be set in the __BindingCreating__ event handler. In this case it should be set to the __SelectedValue__ property.
-````C#
-void radDataEntry1_BindingCreating(object sender, Telerik.WinControls.UI.BindingCreatingEventArgs e)
-{
- if (e.DataMember == "SupplierID")
- {
- e.PropertyName = "SelectedValue";
- }
-}
+#### Map Property
-````
-````VB.NET
-Private Sub radDataEntry1_BindingCreating(sender As Object, e As Telerik.WinControls.UI.BindingCreatingEventArgs)
- If e.DataMember = "SupplierID" Then
- e.PropertyName = "SelectedValue"
- End If
-End Sub
+
+
-````
-{{endregion}}
4\. When the data source is using nullable values in order the user to be able to change the current value via the drop down list, the result value should be manually parsed. This can be done in the binding's __Parse__ event. You can subscribe to this event in the __BindingCreated__ event handler (in order this event to fire the formatting should be enabled).
#### Enable Formatting
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\DataEntryHowTo\ChangeEditorToDropDownList.cs region=created}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\DataEntryHowTo\ChangeEditorToDropDownList.vb region=created}}
-
-````C#
-void radDataEntry1_BindingCreated(object sender, BindingCreatedEventArgs e)
-{
- if (e.DataMember == "SupplierID")
- {
- e.Binding.FormattingEnabled = true;
- e.Binding.Parse += new ConvertEventHandler(Binding_Parse);
- }
-}
-
-private void Binding_Parse(object sender, ConvertEventArgs e)
-{
- int tmpvalue;
- int? result = int.TryParse(e.Value.ToString(), out tmpvalue) ? tmpvalue : (int?)null;
- e.Value = result;
-}
-
-````
-````VB.NET
-Private Sub radDataEntry1_BindingCreated(sender As Object, e As BindingCreatedEventArgs)
- If e.DataMember = "SupplierID" Then
- e.Binding.FormattingEnabled = True
- AddHandler e.Binding.Parse, AddressOf Binding_Parse
- End If
-End Sub
-Private Sub Binding_Parse(sender As Object, e As ConvertEventArgs)
- Dim tmpvalue As Integer
- Dim result As System.Nullable(Of Integer) = If(Integer.TryParse(e.Value.ToString(), tmpvalue), tmpvalue, DirectCast(Nothing, System.Nullable(Of Integer)))
- e.Value = result
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
+
To make the example complete you can use the following classes.
#### Data Models
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\DataEntryHowTo\ChangeEditorToDropDownList.cs region=data}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\DataEntryHowTo\ChangeEditorToDropDownList.vb region=data}}
-
-````C#
-public class Product
-{
- private int? _supplierID;
- private string _productName;
- public Product(int? supplierID, string productName)
- {
- this._supplierID = supplierID;
- this._productName = productName;
- }
- public int? SupplierID
- {
- get
- {
- return this._supplierID;
- }
- set
- {
- this._supplierID = value;
- }
- }
- public string ProductName
- {
- get
- {
- return this._productName;
- }
- set
- {
- this._productName = value;
- }
- }
-}
-public partial class Supplier
-{
- private int? _supplierID;
- private string _companyName;
- public Supplier(int? supplierID, string companyName)
- {
- this._supplierID = supplierID;
- this._companyName = companyName;
- }
- public int? SupplierID
- {
- get
- {
- return this._supplierID;
- }
- set
- {
- this._supplierID = value;
- }
- }
- public string CompanyName
- {
- get
- {
- return this._companyName;
- }
- set
- {
- this._companyName = value;
- }
- }
-}
-
-````
-````VB.NET
-Public Class Product
- Private _supplierID As System.Nullable(Of Integer)
- Private _productName As String
- Public Sub New(supplierID As System.Nullable(Of Integer), productName As String)
- Me._supplierID = supplierID
- Me._productName = productName
- End Sub
- Public Property SupplierID() As System.Nullable(Of Integer)
- Get
- Return Me._supplierID
- End Get
- Set(value As System.Nullable(Of Integer))
- Me._supplierID = value
- End Set
- End Property
- Public Property ProductName() As String
- Get
- Return Me._productName
- End Get
- Set(value As String)
- Me._productName = value
- End Set
- End Property
-End Class
-Partial Public Class Supplier
- Private _supplierID As System.Nullable(Of Integer)
- Private _companyName As String
- Public Sub New(supplierID As System.Nullable(Of Integer), companyName As String)
- Me._supplierID = supplierID
- Me._companyName = companyName
- End Sub
- Public Property SupplierID() As System.Nullable(Of Integer)
- Get
- Return Me._supplierID
- End Get
- Set(value As System.Nullable(Of Integer))
- Me._supplierID = value
- End Set
- End Property
- Public Property CompanyName() As String
- Get
- Return Me._companyName
- End Get
- Set(value As String)
- Me._companyName = value
- End Set
- End Property
-End Class
-
-````
-
-{{endregion}}
+
+
+
+
You can initialize the data sources in the Form’s constructor.
#### Initialize Data
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\DataEntryHowTo\ChangeEditorToDropDownList.cs region=init}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\DataEntryHowTo\ChangeEditorToDropDownList.vb region=init}}
-
-````C#
-List productList;
-List suplierList;
-BindingSource productsBinding;
-public ChangeEditorToDropDownList()
-{
- InitializeComponent();
- productList = new List();
- suplierList = new List();
- productList.Add(new Product(1, "Chai"));
- productList.Add(new Product(2, "Chang"));
- productList.Add(new Product(3, "Aniseed Syrup"));
- productList.Add(new Product(4, "Chef Anton's Gumbo Mix"));
- productList.Add(new Product(5, "Tofu"));
- productList.Add(new Product(null, "Sir Rodney's Marmalade"));
- productList.Add(new Product(6, "Boston Crab Meat"));
- productList.Add(new Product(5, "Chartreuse verte"));
- productList.Add(new Product(2, "Ravioli Angelo"));
- productList.Add(new Product(4, "Perth Pasties"));
- suplierList.Add(new Supplier(1, "Exotic Liquids"));
- suplierList.Add(new Supplier(2, "New Orleans Cajun Delights"));
- suplierList.Add(new Supplier(3, "Tokyo Traders"));
- suplierList.Add(new Supplier(4, "Norske Meierier"));
- suplierList.Add(new Supplier(5, "New England Seafood Cannery"));
- suplierList.Add(new Supplier(6, "Leka Trading"));
- productsBinding = new BindingSource();
- productsBinding.DataSource = productList;
-}
-
-````
-````VB.NET
-Private productList As List(Of Product)
-Private suplierList As List(Of Supplier)
-Private productsBinding As BindingSource
-Public Sub New()
- InitializeComponent()
- productList = New List(Of Product)()
- suplierList = New List(Of Supplier)()
- productList.Add(New Product(1, "Chai"))
- productList.Add(New Product(2, "Chang"))
- productList.Add(New Product(3, "Aniseed Syrup"))
- productList.Add(New Product(4, "Chef Anton's Gumbo Mix"))
- productList.Add(New Product(5, "Tofu"))
- productList.Add(New Product(Nothing, "Sir Rodney's Marmalade"))
- productList.Add(New Product(6, "Boston Crab Meat"))
- productList.Add(New Product(5, "Chartreuse verte"))
- productList.Add(New Product(2, "Ravioli Angelo"))
- productList.Add(New Product(4, "Perth Pasties"))
- suplierList.Add(New Supplier(1, "Exotic Liquids"))
- suplierList.Add(New Supplier(2, "New Orleans Cajun Delights"))
- suplierList.Add(New Supplier(3, "Tokyo Traders"))
- suplierList.Add(New Supplier(4, "Norske Meierier"))
- suplierList.Add(New Supplier(5, "New England Seafood Cannery"))
- suplierList.Add(New Supplier(6, "Leka Trading"))
- productsBinding = New BindingSource()
- productsBinding.DataSource = productList
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
# See Also
diff --git a/controls/dataentry/how-to/handle-unsupported-values.md b/controls/dataentry/how-to/handle-unsupported-values.md
index 8dba0bfd2..a67ca404e 100644
--- a/controls/dataentry/how-to/handle-unsupported-values.md
+++ b/controls/dataentry/how-to/handle-unsupported-values.md
@@ -21,89 +21,30 @@ The following example demonstrates how to do that:
#### Map Nullable Property
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\DataEntryHowTo\HandleUnsupportedValues.cs region=BindingCreating}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\DataEntryHowTo\HandleUnsupportedValues.vb region=BindingCreating}}
+
+
-````C#
-void radDataEntry1_BindingCreating(object sender, BindingCreatingEventArgs e)
-{
- if (e.DataMember == "DateTime")
- {
- e.PropertyName = "NullableValue";
- }
-}
-````
-````VB.NET
-Private Sub radDataEntry1_BindingCreating(sender As Object, e As BindingCreatingEventArgs)
- If e.DataMember = "DateTime" Then
- e.PropertyName = "NullableValue"
- End If
-End Sub
-
-````
-
-{{endregion}}
2\. Then in the __BindingCreated__ event you will enable the binding formatting and will subscribe to its __Format__ event.
#### Enable Formatting
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\DataEntryHowTo\HandleUnsupportedValues.cs region=BindingCreated}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\DataEntryHowTo\HandleUnsupportedValues.vb region=BindingCreated}}
-
-````C#
-void radDataEntry1_BindingCreated(object sender, BindingCreatedEventArgs e)
-{
- if (e.DataMember == "DateTime")
- {
- e.Binding.FormattingEnabled = true;
- e.Binding.Format += Binding_Format;
- }
-}
+
+
-````
-````VB.NET
-Private Sub radDataEntry1_BindingCreated(sender As Object, e As BindingCreatedEventArgs)
- If e.DataMember = "DateTime" Then
- e.Binding.FormattingEnabled = True
- AddHandler e.Binding.Format, AddressOf Binding_Format
- End If
-End Sub
-````
-
-{{endregion}}
3\. At the end we just need to interpret the *DBNull* values as *null* values:
#### Evaluate DBNull
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\DataEntryHowTo\HandleUnsupportedValues.cs region=Format}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\DataEntryHowTo\HandleUnsupportedValues.vb region=Format}}
-
-````C#
-void Binding_Format(object sender, ConvertEventArgs e)
-{
- if (e.Value.Equals(DBNull.Value))
- {
- e.Value = null;
- }
-}
-
-````
-````VB.NET
-Private Sub Binding_Format(sender As Object, e As ConvertEventArgs)
- If e.Value.Equals(DBNull.Value) Then
- e.Value = Nothing
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
# See Also
diff --git a/controls/dataentry/programmatically-arrange-items-.md b/controls/dataentry/programmatically-arrange-items-.md
index 1482be0eb..f86aa9c7f 100644
--- a/controls/dataentry/programmatically-arrange-items-.md
+++ b/controls/dataentry/programmatically-arrange-items-.md
@@ -17,161 +17,17 @@ Items in __RadDataEntry__ can be arranged both at design time and run time. At d
#### Data Object
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.cs region=empl1}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.vb region=empl1}}
-
-````C#
-private class Employee
-{
- public string FirstName
- {
- get;
- set;
- }
- public string LastName
- {
- get;
- set;
- }
- public string Occupation
- {
- get;
- set;
- }
- public DateTime StartingDate
- {
- get;
- set;
- }
- public bool IsMarried
- {
- get;
- set;
- }
- public int Salary
- {
- get;
- set;
- }
- public Gender Gender
- {
- get;
- set;
- }
-}
-private enum Gender
-{
- Female,
- Male
-}
-
-````
-````VB.NET
-Private Class Employee
- Public Property FirstName() As String
- Get
- Return m_FirstName
- End Get
- Set(value As String)
- m_FirstName = Value
- End Set
- End Property
- Private m_FirstName As String
- Public Property LastName() As String
- Get
- Return m_LastName
- End Get
- Set(value As String)
- m_LastName = Value
- End Set
- End Property
- Private m_LastName As String
- Public Property Occupation() As String
- Get
- Return m_Occupation
- End Get
- Set(value As String)
- m_Occupation = Value
- End Set
- End Property
- Private m_Occupation As String
- Public Property StartingDate() As DateTime
- Get
- Return m_StartingDate
- End Get
- Set(value As DateTime)
- m_StartingDate = Value
- End Set
- End Property
- Private m_StartingDate As DateTime
- Public Property IsMarried() As Boolean
- Get
- Return m_IsMarried
- End Get
- Set(value As Boolean)
- m_IsMarried = Value
- End Set
- End Property
- Private m_IsMarried As Boolean
- Public Property Salary() As Integer
- Get
- Return m_Salary
- End Get
- Set(value As Integer)
- m_Salary = Value
- End Set
- End Property
- Private m_Salary As Integer
- Public Property Gender() As Gender
- Get
- Return m_Gender
- End Get
- Set(value As Gender)
- m_Gender = Value
- End Set
- End Property
- Private m_Gender As Gender
-End Class
-Private Enum Gender
- Female
- Male
-End Enum
-
-````
-
-{{endregion}}
+
+
+
+
#### Data Binding
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.cs region=bind1}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.vb region=bind1}}
-
-````C#
-this.radDataEntry1.DataSource = new Employee()
-{
- FirstName = "Sarah",
- LastName = "Blake",
- Occupation = "Supplied Manager",
- StartingDate = new DateTime(2005, 04, 12),
- IsMarried = true,
- Salary = 3500, Gender = Gender.Female
-};
-
-````
-````VB.NET
-Me.radDataEntry1.DataSource = New Employee() With { _
- .FirstName = "Sarah", _
- .LastName = "Blake", _
- .Occupation = "Supplied Manager", _
- .StartingDate = New DateTime(2005, 4, 12), _
- .IsMarried = True, _
- .Salary = 3500, _
- .Gender = Gender.Female _
- }
-
-````
-
-{{endregion}}
+
+
+
+
>caption Figure 1: RadDataEntry is initialized.
@@ -181,47 +37,10 @@ Me.radDataEntry1.DataSource = New Employee() With { _
#### Special Arrangement
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryHowTo.cs region=ItemInitialized}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryHowTo.vb region=ItemInitialized}}
-
-````C#
-void radDataEntry1_ItemInitialized(object sender, Telerik.WinControls.UI.ItemInitializedEventArgs e)
-{
- if (e.Panel.Controls[1].Text == "FirstName")
- {
- e.Panel.Size = new Size(150, 25);
- e.Panel.Controls[1].Text = "Name";
- }
- else if (e.Panel.Controls[1].Text == "LastName")
- {
- e.Panel.Size = new Size(100, 25);
- e.Panel.Controls[1].Visible = false;
- e.Panel.Location = new Point(160, radDataEntry1.ItemSpace);
- }
- else
- {
- e.Panel.Location = new Point(e.Panel.Location.X, e.Panel.Location.Y - 25);
- }
-}
-
-````
-````VB.NET
-Private Sub radDataEntry1_ItemInitialized(sender As Object, e As Telerik.WinControls.UI.ItemInitializedEventArgs)
- If e.Panel.Controls(1).Text = "FirstName" Then
- e.Panel.Size = New Size(150, 25)
- e.Panel.Controls(1).Text = "Name"
- ElseIf e.Panel.Controls(1).Text = "LastName" Then
- e.Panel.Size = New Size(100, 25)
- e.Panel.Controls(1).Visible = False
- e.Panel.Location = New Point(160, radDataEntry1.ItemSpace)
- Else
- e.Panel.Location = New Point(e.Panel.Location.X, e.Panel.Location.Y - 25)
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
>caption Figure 2: The whole name is now displayed in the first row.
diff --git a/controls/dataentry/properties-events-and-attributes.md b/controls/dataentry/properties-events-and-attributes.md
index 6a0a8e53a..f0175c9c0 100644
--- a/controls/dataentry/properties-events-and-attributes.md
+++ b/controls/dataentry/properties-events-and-attributes.md
@@ -19,35 +19,10 @@ The main purpose of __RadDataEntry__ is to generate editors according to the obj
#### RadDataEntry Binding.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.cs region=bind1}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.vb region=bind1}}
-
-````C#
-this.radDataEntry1.DataSource = new Employee()
-{
- FirstName = "Sarah",
- LastName = "Blake",
- Occupation = "Supplied Manager",
- StartingDate = new DateTime(2005, 04, 12),
- IsMarried = true,
- Salary = 3500, Gender = Gender.Female
-};
-
-````
-````VB.NET
-Me.radDataEntry1.DataSource = New Employee() With { _
- .FirstName = "Sarah", _
- .LastName = "Blake", _
- .Occupation = "Supplied Manager", _
- .StartingDate = New DateTime(2005, 4, 12), _
- .IsMarried = True, _
- .Salary = 3500, _
- .Gender = Gender.Female _
- }
-
-````
-
-{{endregion}}
+
+
+
+
>caption> Figure 1: Set The Data Source of RadDataEntry
@@ -57,19 +32,10 @@ Me.radDataEntry1.DataSource = New Employee() With { _
#### Set the Columns Count.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryProgram.cs region=NumberOfColumns}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryProgram.vb region=NumberOfColumns}}
-
-````C#
-this.radDataEntry1.ColumnCount = 2;
-
-````
-````VB.NET
-Me.radDataEntry1.ColumnCount = 2
-
-````
+
+
-{{endregion}}
+
>caption Figure 2: Set The Columns Count.
@@ -79,19 +45,10 @@ Me.radDataEntry1.ColumnCount = 2
#### Set FitToParentWidth Property.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryProgram.cs region=FitToParentWidth}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryProgram.vb region=FitToParentWidth}}
-
-````C#
-this.radDataEntry1.FitToParentWidth = true;
-
-````
-````VB.NET
-Me.radDataEntry1.FitToParentWidth = True
+
+
-````
-
-{{endregion}}
+
>caption Figure 3. Set FitToParentWidth
@@ -101,33 +58,10 @@ Me.radDataEntry1.FitToParentWidth = True
#### Setup the Validation Panel.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryProgram.cs region=ShowValidationPanel}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryProgram.vb region=ShowValidationPanel}}
-
-````C#
-this.radDataEntry1.ShowValidationPanel = true;
-RadLabel label = new RadLabel();
-label.Name = "First Name";
-label.Text = "First Name : First Name should be between 2 and 15 chars long.";
-label.Dock = DockStyle.Top;
-label.AutoSize = false;
-label.BackColor = Color.Transparent;
-this.radDataEntry1.ValidationPanel.PanelContainer.Controls.Add(label);
-
-````
-````VB.NET
-Me.radDataEntry1.ShowValidationPanel = True
-Dim label As New RadLabel()
-label.Name = "First Name"
-label.Text = "First Name : First Name should be between 2 and 15 chars long."
-label.Dock = DockStyle.Top
-label.AutoSize = False
-label.BackColor = Color.Transparent
-Me.radDataEntry1.ValidationPanel.PanelContainer.Controls.Add(label)
-
-````
-
-{{endregion}}
+
+
+
+
>caption Figure 4: The Validation Panel.
@@ -137,21 +71,10 @@ Me.radDataEntry1.ValidationPanel.PanelContainer.Controls.Add(label)
### Set the Flow Direction.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryProgram.cs region=FillingOrder1}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryProgram.vb region=FillingOrder1}}
-
-````C#
-this.radDataEntry1.ColumnCount = 2;
-this.radDataEntry1.FlowDirection = FlowDirection.BottomUp;
-
-````
-````VB.NET
-Me.radDataEntry1.ColumnCount = 2
-Me.radDataEntry1.FlowDirection = FlowDirection.BottomUp
-
-````
+
+
-{{endregion}}
+
>caption Figure 5: Set the flow direction.
@@ -161,19 +84,10 @@ Me.radDataEntry1.FlowDirection = FlowDirection.BottomUp
#### Set Space Between The Items.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryProgram.cs region=ItemSpace}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryProgram.vb region=ItemSpace}}
-
-````C#
-this.radDataEntry1.ItemSpace = 10;
-
-````
-````VB.NET
-Me.radDataEntry1.ItemSpace = 10
-
-````
+
+
-{{endregion}}
+
>caption Figure 6 Set the items space.
@@ -183,19 +97,10 @@ Me.radDataEntry1.ItemSpace = 10
#### Set items default size.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryProgram.cs region=ItemDefaultSize}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryProgram.vb region=ItemDefaultSize}}
-
-````C#
-this.radDataEntry1.ItemDefaultSize = new Size(300, 30);
-
-````
-````VB.NET
-Me.radDataEntry1.ItemDefaultSize = New Size(300, 30)
+
+
-````
-
-{{endregion}}
+
>caption Figure 7. Set items size.
@@ -205,19 +110,10 @@ Me.radDataEntry1.ItemDefaultSize = New Size(300, 30)
#### Set The AutoSizeLabels Property.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryProgram.cs region=ResizeLabels}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryProgram.vb region=ResizeLabels}}
+
+
-````C#
-this.radDataEntry1.AutoSizeLabels = true;
-
-````
-````VB.NET
-Me.radDataEntry1.AutoSizeLabels = True
-
-````
-
-{{endregion}}
+
>caption Figure 8: The Labels are not Auto-Sized.
@@ -254,66 +150,20 @@ With the __Browsable__ attribute users can easily control which properties shoul
#### Set The Browsable Attribute.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryProgram.cs region=Browsable}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryProgram.vb region=Browsable}}
-
-````C#
-[Browsable(false)]
-public string PhoneNumber
-{
- get;
- set;
-}
+
+
-````
-````VB.NET
- _
-Public Property PhoneNumber() As String
- Get
- Return m_PhoneNumber
- End Get
- Set(value As String)
- m_PhoneNumber = Value
- End Set
-End Property
-Private m_PhoneNumber As String
-
-````
-
-{{endregion}}
+
The __DisplayName__ attribute defines what text should be displayed in the label that is associated with the editor.
#### Set The DisplayName Attribute.
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryProgram.cs region=DisplayName}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryProgram.vb region=DisplayName}}
-
-````C#
-[DisplayName("family name")]
-public string LastName
-{
- get;
- set;
-}
-
-````
-````VB.NET
- _
-Public Property LastName() As String
- Get
- Return m_LastName
- End Get
- Set(value As String)
- m_LastName = Value
- End Set
-End Property
-Private m_LastName As String
+
+
-````
-
-{{endregion}}
+

@@ -322,33 +172,10 @@ With __RadRange__ attribute users can define range that can be used into validat
#### Set The RadRange Attribute
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryProgram.cs region=RadRange}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryProgram.vb region=RadRange}}
-
-````C#
-[RadRange(1500,2000)]
-public int Salary
-{
- get;
- set;
-}
-
-````
-````VB.NET
- _
-Public Property Salary() As Integer
- Get
- Return m_Salary
- End Get
- Set(value As Integer)
- m_Salary = Value
- End Set
-End Property
-Private m_Salary As Integer
-
-````
-
-{{endregion}}
+
+
+
+
# See Also
diff --git a/controls/dataentry/validation.md b/controls/dataentry/validation.md
index 123673a18..5d5f1dbee 100644
--- a/controls/dataentry/validation.md
+++ b/controls/dataentry/validation.md
@@ -17,162 +17,19 @@ For the need of validation process we made two events (__ItemValidating, ItemVal
#### DataObject
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.cs region=empl1}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.vb region=empl1}}
+
+
-````C#
-private class Employee
-{
- public string FirstName
- {
- get;
- set;
- }
- public string LastName
- {
- get;
- set;
- }
- public string Occupation
- {
- get;
- set;
- }
- public DateTime StartingDate
- {
- get;
- set;
- }
- public bool IsMarried
- {
- get;
- set;
- }
- public int Salary
- {
- get;
- set;
- }
- public Gender Gender
- {
- get;
- set;
- }
-}
-private enum Gender
-{
- Female,
- Male
-}
-````
-````VB.NET
-Private Class Employee
- Public Property FirstName() As String
- Get
- Return m_FirstName
- End Get
- Set(value As String)
- m_FirstName = Value
- End Set
- End Property
- Private m_FirstName As String
- Public Property LastName() As String
- Get
- Return m_LastName
- End Get
- Set(value As String)
- m_LastName = Value
- End Set
- End Property
- Private m_LastName As String
- Public Property Occupation() As String
- Get
- Return m_Occupation
- End Get
- Set(value As String)
- m_Occupation = Value
- End Set
- End Property
- Private m_Occupation As String
- Public Property StartingDate() As DateTime
- Get
- Return m_StartingDate
- End Get
- Set(value As DateTime)
- m_StartingDate = Value
- End Set
- End Property
- Private m_StartingDate As DateTime
- Public Property IsMarried() As Boolean
- Get
- Return m_IsMarried
- End Get
- Set(value As Boolean)
- m_IsMarried = Value
- End Set
- End Property
- Private m_IsMarried As Boolean
- Public Property Salary() As Integer
- Get
- Return m_Salary
- End Get
- Set(value As Integer)
- m_Salary = Value
- End Set
- End Property
- Private m_Salary As Integer
- Public Property Gender() As Gender
- Get
- Return m_Gender
- End Get
- Set(value As Gender)
- m_Gender = Value
- End Set
- End Property
- Private m_Gender As Gender
-End Class
-Private Enum Gender
- Female
- Male
-End Enum
-````
-
-{{endregion}}
#### Data Binding
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.cs region=bind1}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryGettingStarted.vb region=bind1}}
-
-````C#
-this.radDataEntry1.DataSource = new Employee()
-{
- FirstName = "Sarah",
- LastName = "Blake",
- Occupation = "Supplied Manager",
- StartingDate = new DateTime(2005, 04, 12),
- IsMarried = true,
- Salary = 3500, Gender = Gender.Female
-};
-
-````
-````VB.NET
-Me.radDataEntry1.DataSource = New Employee() With { _
- .FirstName = "Sarah", _
- .LastName = "Blake", _
- .Occupation = "Supplied Manager", _
- .StartingDate = New DateTime(2005, 4, 12), _
- .IsMarried = True, _
- .Salary = 3500, _
- .Gender = Gender.Female _
- }
+
+
-````
-{{endregion}}
>caption Figure 1: RadDataEntry is initialized.
@@ -181,158 +38,21 @@ Me.radDataEntry1.DataSource = New Employee() With { _
2\. Set the __ShowValidationPanel__ property to true. This will display the panel below the editors:
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryHowTo.cs region=ShowValidationPanel2}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryHowTo.vb region=ShowValidationPanel2}}
+
+
-````C#
-this.radDataEntry1.ShowValidationPanel = true;
-````
-````VB.NET
-Me.radDataEntry1.ShowValidationPanel = True
-````
-
-{{endregion}}
3\. Subscribe to the __ItemValidated__ event of __RadDataEntry__:
#### Data Validation
-{{source=..\SamplesCS\DataEntryAndBindingNavigator\RadDataEntryHowTo.cs region=ItemValidated}}
-{{source=..\SamplesVB\DataEntryAndBindingNavigator\RadDataEntryHowTo.vb region=ItemValidated}}
-
-````C#
-void radDataEntry1_ItemValidated(object sender, ItemValidatedEventArgs e)
-{
- Employee employee = this.radDataEntry1.CurrentObject as Employee;
- if (e.Label.Text == "FirstName")
- {
- if (employee.FirstName.Length < 2 || employee.FirstName.Length > 15)
- {
- e.ErrorProvider.SetError((sender as Control), "First Name should be between 2 and 15 chars long.");
- if (!this.radDataEntry1.ValidationPanel.PanelContainer.Controls.ContainsKey("FirstName"))
- {
- RadLabel label = new RadLabel();
- label.Name = "FirstName";
- label.Text = "FirstName : First Name should be between 2 and 15 chars long.";
- label.Dock = DockStyle.Top;
- label.AutoSize = false;
- label.BackColor = Color.Transparent;
- this.radDataEntry1.ValidationPanel.PanelContainer.Controls.Add(label);
- }
- }
- else
- {
- e.ErrorProvider.Clear();
- this.radDataEntry1.ValidationPanel.PanelContainer.Controls.RemoveByKey("FirstName");
- }
- }
- else if (e.Label.Text == "LastName")
- {
- if (employee.LastName.Length < 2 || employee.LastName.Length > 15)
- {
- e.ErrorProvider.SetError((sender as Control), "Last Name should be between 2 and 15 chars long.");
- if (!this.radDataEntry1.ValidationPanel.PanelContainer.Controls.ContainsKey("LastName"))
- {
- RadLabel label = new RadLabel();
- label.Name = "LastName";
- label.Text = "LastName : Last Name should be between 2 and 15 chars long.";
- label.Dock = DockStyle.Top;
- label.AutoSize = false;
- label.BackColor = Color.Transparent;
- this.radDataEntry1.ValidationPanel.PanelContainer.Controls.Add(label);
- }
- }
- else
- {
- e.ErrorProvider.Clear();
- this.radDataEntry1.ValidationPanel.PanelContainer.Controls.RemoveByKey("LastName");
- }
- }
- else if (e.Label.Text == "Salary")
- {
- if (employee.Salary < 1500 || employee.Salary > 1700)
- {
- e.ErrorProvider.SetError((sender as Control), "Salary should be in range 1500 - 1700.");
- if (!this.radDataEntry1.ValidationPanel.PanelContainer.Controls.ContainsKey("Salary"))
- {
- RadLabel label = new RadLabel();
- label.Name = "Salary";
- label.Text = "Salary : Salary should be in range 1500 - 1700.";
- label.Dock = DockStyle.Top;
- label.AutoSize = false;
- label.BackColor = Color.Transparent;
- this.radDataEntry1.ValidationPanel.PanelContainer.Controls.Add(label);
- }
- }
- else
- {
- e.ErrorProvider.Clear();
- this.radDataEntry1.ValidationPanel.PanelContainer.Controls.RemoveByKey("Salary");
- }
- }
-}
-
-````
-````VB.NET
-Private Sub radDataEntry1_ItemValidated(sender As Object, e As ItemValidatedEventArgs)
- Dim employee As Employee = TryCast(Me.radDataEntry1.CurrentObject, Employee)
- If e.Label.Text = "FirstName" Then
- If employee.FirstName.Length < 2 OrElse employee.FirstName.Length > 15 Then
- e.ErrorProvider.SetError(TryCast(sender, Control), "First Name should be between 2 and 15 chars long.")
- If Not Me.radDataEntry1.ValidationPanel.PanelContainer.Controls.ContainsKey("FirstName") Then
- Dim label As New RadLabel()
- label.Name = "FirstName"
- label.Text = "FirstName : First Name should be between 2 and 15 chars long."
- label.Dock = DockStyle.Top
- label.AutoSize = False
- label.BackColor = Color.Transparent
- Me.radDataEntry1.ValidationPanel.PanelContainer.Controls.Add(label)
- End If
- Else
- e.ErrorProvider.Clear()
- Me.radDataEntry1.ValidationPanel.PanelContainer.Controls.RemoveByKey("FirstName")
- End If
- ElseIf e.Label.Text = "LastName" Then
- If employee.LastName.Length < 2 OrElse employee.LastName.Length > 15 Then
- e.ErrorProvider.SetError(TryCast(sender, Control), "Last Name should be between 2 and 15 chars long.")
- If Not Me.radDataEntry1.ValidationPanel.PanelContainer.Controls.ContainsKey("LastName") Then
- Dim label As New RadLabel()
- label.Name = "LastName"
- label.Text = "LastName : Last Name should be between 2 and 15 chars long."
- label.Dock = DockStyle.Top
- label.AutoSize = False
- label.BackColor = Color.Transparent
- Me.radDataEntry1.ValidationPanel.PanelContainer.Controls.Add(label)
- End If
- Else
- e.ErrorProvider.Clear()
- Me.radDataEntry1.ValidationPanel.PanelContainer.Controls.RemoveByKey("LastName")
- End If
- ElseIf e.Label.Text = "Salary" Then
- If employee.Salary < 1500 OrElse employee.Salary > 1700 Then
- e.ErrorProvider.SetError(TryCast(sender, Control), "Salary should be in range 1500 - 1700.")
- If Not Me.radDataEntry1.ValidationPanel.PanelContainer.Controls.ContainsKey("Salary") Then
- Dim label As New RadLabel()
- label.Name = "Salary"
- label.Text = "Salary : Salary should be in range 1500 - 1700."
- label.Dock = DockStyle.Top
- label.AutoSize = False
- label.BackColor = Color.Transparent
- Me.radDataEntry1.ValidationPanel.PanelContainer.Controls.Add(label)
- End If
- Else
- e.ErrorProvider.Clear()
- Me.radDataEntry1.ValidationPanel.PanelContainer.Controls.RemoveByKey("Salary")
- End If
- End If
-End Sub
+
+
-````
-{{endregion}}
>caption Figure 2. The Validation panels shows the error message.
diff --git a/controls/datafilter/customizing-appearance/custom-display-names.md b/controls/datafilter/customizing-appearance/custom-display-names.md
index f7cfc49b2..b2998cdc5 100644
--- a/controls/datafilter/customizing-appearance/custom-display-names.md
+++ b/controls/datafilter/customizing-appearance/custom-display-names.md
@@ -18,30 +18,10 @@ The names behind each of the descriptor items are extracted from the data-bound
#### PropertyDisplayNameNeeded Event
-{{source=..\SamplesCS\DataFilter\DataFilterWorkingWithNodes.cs region=CustomDisplayNames}}
-{{source=..\SamplesVB\DataFilter\DataFilterWorkingWithNodes.vb region=CustomDisplayNames}}
-````C#
-private void RadDataFilter1_PropertyDisplayNameNeeded(object sender, PropertyDisplayNameNeededEventArgs e)
-{
- if (e.FieldName == "BirthDay")
- {
- e.DisplayName = "Birth Day";
- }
-}
-
-````
-````VB.NET
-Private Sub RadDataFilter1_PropertyDisplayNameNeeded(sender As Object, e As PropertyDisplayNameNeededEventArgs)
- If e.FieldName = "Birth Day" Then
- e.DisplayName = "Birth Day"
- End If
-End Sub
-
-````
-
-
-
-{{endregion}}
+
+
+
+
# See Also
diff --git a/controls/datafilter/customizing-appearance/formatting-nodes.md b/controls/datafilter/customizing-appearance/formatting-nodes.md
index faa2afbd9..219e238a5 100644
--- a/controls/datafilter/customizing-appearance/formatting-nodes.md
+++ b/controls/datafilter/customizing-appearance/formatting-nodes.md
@@ -25,38 +25,10 @@ Group nodes can be formatted to handle custom scenarios. The root node in the ex
#### Group Nodes
-{{source=..\SamplesCS\DataFilter\DataFilterWorkingWithNodes.cs region=GroupNodes}}
-{{source=..\SamplesVB\DataFilter\DataFilterWorkingWithNodes.vb region=GroupNodes}}
-````C#
-private void radDataFilter1_NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
-{
- DataFilterGroupElement dataGroupFilterElement = e.NodeElement as DataFilterGroupElement;
- if (dataGroupFilterElement != null && dataGroupFilterElement.IsRootNode)
- {
- dataGroupFilterElement.ExpanderElement.Visibility = ElementVisibility.Collapsed;
- }
- else
- {
- e.NodeElement.ResetValue(LightVisualElement.VisibilityProperty, ValueResetFlags.Local);
- }
-}
-
-````
-````VB.NET
-Private Sub radDataFilter1_NodeFormatting(sender As Object, e As TreeNodeFormattingEventArgs)
- Dim dataGroupFilterElement As DataFilterGroupElement = TryCast(e.NodeElement, DataFilterGroupElement)
- If dataGroupFilterElement IsNot Nothing AndAlso dataGroupFilterElement.IsRootNode Then
- dataGroupFilterElement.ExpanderElement.Visibility = ElementVisibility.Collapsed
- Else
- e.NodeElement.ResetValue(LightVisualElement.VisibilityProperty, ValueResetFlags.Local)
- End If
-End Sub
-
-````
-
-
-
-{{endregion}}
+
+
+
+
## Formatting Expression Nodes
@@ -68,38 +40,10 @@ The appearance of the expression nodes can also be modified to change their visu
#### Expression Nodes
-{{source=..\SamplesCS\DataFilter\DataFilterWorkingWithNodes.cs region=ExpressionNodes}}
-{{source=..\SamplesVB\DataFilter\DataFilterWorkingWithNodes.vb region=ExpressionNodes}}
-````C#
-private void radDataFilter1_NodeFormatting1(object sender, TreeNodeFormattingEventArgs e)
-{
- DataFilterCriteriaElement dataExpressionFilterElement = e.NodeElement as DataFilterCriteriaElement;
- if (dataExpressionFilterElement != null && dataExpressionFilterElement.CriteriaNode.Descriptor.PropertyName == "Name")
- {
- dataExpressionFilterElement.ContentElement.BackColor = Color.LightBlue;
- }
- else
- {
- e.NodeElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
- }
-}
-
-````
-````VB.NET
-Private Sub radDataFilter1_NodeFormatting1(sender As Object, e As TreeNodeFormattingEventArgs)
- Dim dataExpressionFilterElement As DataFilterCriteriaElement = TryCast(e.NodeElement, DataFilterCriteriaElement)
- If dataExpressionFilterElement IsNot Nothing AndAlso dataExpressionFilterElement.CriteriaNode.Descriptor.PropertyName = "Name" Then
- dataExpressionFilterElement.ContentElement.BackColor = Color.LightBlue
- Else
- e.NodeElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local)
- End If
-End Sub
-
-````
-
-
-
-{{endregion}}
+
+
+
+
## Formatting Button Nodes
@@ -111,38 +55,10 @@ The button responsible for adding a new expression can also be customized in a f
#### Button Nodes
-{{source=..\SamplesCS\DataFilter\DataFilterWorkingWithNodes.cs region=AddButton}}
-{{source=..\SamplesVB\DataFilter\DataFilterWorkingWithNodes.vb region=AddButton}}
-````C#
-private void radDataFilter1_NodeFormatting2(object sender, TreeNodeFormattingEventArgs e)
-{
- DataFilterAddNodeElement dataAddNodeElement = e.NodeElement as DataFilterAddNodeElement;
- if (dataAddNodeElement != null && dataAddNodeElement.DropDownButton.Text == "Add")
- {
- dataAddNodeElement.DropDownButton.Text = "Add Filter";
- }
- else
- {
- e.NodeElement.ResetValue(LightVisualElement.VisibilityProperty, ValueResetFlags.Local);
- }
-}
-
-````
-````VB.NET
-Private Sub radDataFilter1_NodeFormatting2(sender As Object, e As TreeNodeFormattingEventArgs)
- Dim dataAddNodeElement As DataFilterAddNodeElement = TryCast(e.NodeElement, DataFilterAddNodeElement)
- If dataAddNodeElement IsNot Nothing AndAlso dataAddNodeElement.DropDownButton.Text = "Add" Then
- dataAddNodeElement.DropDownButton.Text = "Add Filter"
- Else
- e.NodeElement.ResetValue(LightVisualElement.VisibilityProperty, ValueResetFlags.Local)
- End If
-End Sub
-
-````
-
-
-
-{{endregion}}
+
+
+
+
## Formatting Child Expression Elements
@@ -154,69 +70,10 @@ Each of the nodes holding the expressions has three editor elements which can be
#### Child Expression Elements
-{{source=..\SamplesCS\DataFilter\DataFilterWorkingWithNodes.cs region=ChildExpressionElements}}
-{{source=..\SamplesVB\DataFilter\DataFilterWorkingWithNodes.vb region=ChildExpressionElements}}
-````C#
-private void radDataFilter1_NodeFormatting3(object sender, TreeNodeFormattingEventArgs e)
-{
- DataFilterCriteriaElement dataExpressionFilterElement = e.NodeElement as DataFilterCriteriaElement;
- if (dataExpressionFilterElement == null)
- {
- return;
- }
- if (dataExpressionFilterElement.CriteriaNode.Descriptor.PropertyName == "Id")
- {
- dataExpressionFilterElement.FieldElement.DrawFill = true;
- dataExpressionFilterElement.FieldElement.GradientStyle = GradientStyles.Solid;
- dataExpressionFilterElement.FieldElement.BackColor = Color.LightGreen;
- dataExpressionFilterElement.OperatorElement.ForeColor = Color.Red;
- dataExpressionFilterElement.ValueElement.DrawFill = true;
- dataExpressionFilterElement.ValueElement.GradientStyle = GradientStyles.Solid;
- dataExpressionFilterElement.ValueElement.BackColor = Color.LightBlue;
- }
- else
- {
- dataExpressionFilterElement.FieldElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
- dataExpressionFilterElement.FieldElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
- dataExpressionFilterElement.FieldElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
- dataExpressionFilterElement.OperatorElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local);
- dataExpressionFilterElement.ValueElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
- dataExpressionFilterElement.ValueElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
- dataExpressionFilterElement.ValueElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
- }
-}
-
-````
-````VB.NET
-Private Sub radDataFilter1_NodeFormatting3(sender As Object, e As TreeNodeFormattingEventArgs)
- Dim dataExpressionFilterElement As DataFilterCriteriaElement = TryCast(e.NodeElement, DataFilterCriteriaElement)
- If dataExpressionFilterElement Is Nothing Then
- Return
- End If
- If dataExpressionFilterElement.CriteriaNode.Descriptor.PropertyName = "Id" Then
- dataExpressionFilterElement.FieldElement.DrawFill = True
- dataExpressionFilterElement.FieldElement.GradientStyle = GradientStyles.Solid
- dataExpressionFilterElement.FieldElement.BackColor = Color.LightGreen
- dataExpressionFilterElement.OperatorElement.ForeColor = Color.Red
- dataExpressionFilterElement.ValueElement.DrawFill = True
- dataExpressionFilterElement.ValueElement.GradientStyle = GradientStyles.Solid
- dataExpressionFilterElement.ValueElement.BackColor = Color.LightBlue
- Else
- dataExpressionFilterElement.FieldElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local)
- dataExpressionFilterElement.FieldElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local)
- dataExpressionFilterElement.FieldElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local)
- dataExpressionFilterElement.OperatorElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local)
- dataExpressionFilterElement.ValueElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local)
- dataExpressionFilterElement.ValueElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local)
- dataExpressionFilterElement.ValueElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local)
- End If
-End Sub
-
-````
-
-
-
-{{endregion}}
+
+
+
+
# See Also
diff --git a/controls/datafilter/datafilter-dialog.md b/controls/datafilter/datafilter-dialog.md
index d9d73a50b..1542f371a 100644
--- a/controls/datafilter/datafilter-dialog.md
+++ b/controls/datafilter/datafilter-dialog.md
@@ -18,27 +18,10 @@ You can find below a sample code snippet how to show the filter dialog and get i
#### Showing the RadDataFilterDialog
-{{source=..\SamplesCS\DataFilter\DataFilterGettingStarted.cs region=FilterDialog}}
-{{source=..\SamplesVB\DataFilter\DataFilterGettingStarted.vb region=FilterDialog}}
-
-````C#
-RadDataFilterDialog dialog = new RadDataFilterDialog();
-dialog.DataSource = this.ordersBindingSource;
-dialog.DataFilter.Expression = "[OrderID] > 10300 AND [EmployeeID] = 2";
-dialog.ShowDialog();
-string expression = dialog.DataFilter.Expression;
-
-````
-````VB.NET
-Dim dialog As New RadDataFilterDialog()
-dialog.DataSource = Me.ordersBindingSource
-dialog.DataFilter.Expression = "[OrderID] > 10300 AND [EmployeeID] = 2"
-dialog.ShowDialog()
-Dim expression As String = dialog.DataFilter.Expression
-
-````
-
-{{endregion}}
+
+
+
+
If you need to customize the performed action on one of the buttons in the filter dialog you can create a derivative of the **RadDataFilterDialog** and override the **OnOKButtonClick**, **OnCancelButtonClick** or **OnApplyButtonClick** methods.
diff --git a/controls/datafilter/editing/custom-editors.md b/controls/datafilter/editing/custom-editors.md
index 14674c3c5..13abe5427 100644
--- a/controls/datafilter/editing/custom-editors.md
+++ b/controls/datafilter/editing/custom-editors.md
@@ -20,150 +20,10 @@ All editors inherit from **BaseInputEditor**. So, you have to inherit from this
#### Custom editor
-{{source=..\SamplesCS\DataFilter\DataFilterCustomEditor.cs region=CustomEditor}}
-{{source=..\SamplesVB\DataFilter\DataFilterCustomEditor.vb region=CustomEditor}}
+
+
-````C#
-public DataFilterCustomEditor()
-{
- InitializeComponent();
- this.radDataFilter1.DataSource = this.productsBindingSource;
- this.radDataFilter1.EditorRequired += radDataFilter1_EditorRequired;
- this.radDataFilter1.EditorInitialized += radDataFilter1_EditorInitialized;
- this.radDataFilter1.ItemHeight = 40;
-}
-private void radDataFilter1_EditorInitialized(object sender, TreeNodeEditorInitializedEventArgs e)
-{
- TrackBarEditor editor = e.Editor as TrackBarEditor;
- if (editor != null)
- {
- RadTrackBarElement element = editor.EditorElement as RadTrackBarElement;
- element.ShowTicks = true;
- element.Maximum = 10;
- }
-}
-private void radDataFilter1_EditorRequired(object sender, TreeNodeEditorRequiredEventArgs e)
-{
- DataFilterCriteriaNode filterNode = e.Node as DataFilterCriteriaNode;
- if (filterNode != null && filterNode.PropertyName == "ProductID" && sender is DataFilterValueEditorElement)
- {
- e.EditorType = typeof(TrackBarEditor);
- }
-}
-public class TrackBarEditor : BaseInputEditor
-{
- public override object Value
- {
- get
- {
- RadTrackBarElement editor = (RadTrackBarElement)this.EditorElement;
- return editor.Value;
- }
- set
- {
- RadTrackBarElement editor = (RadTrackBarElement)this.EditorElement;
- if (value != null && value != DBNull.Value)
- {
- editor.Value = Convert.ToInt32(value);
- }
- else
- {
- editor.Value = 0;
- }
- }
- }
- public override void BeginEdit()
- {
- base.BeginEdit();
- this.EditorElement.Focus();
- ((RadTrackBarElement)this.EditorElement).ValueChanged += new EventHandler(TrackBarEditor_ValueChanged);
- }
- void TrackBarEditor_ValueChanged(object sender, EventArgs e)
- {
- this.OnValueChanged();
- }
- public override bool EndEdit()
- {
- ((RadTrackBarElement)this.EditorElement).ValueChanged -= TrackBarEditor_ValueChanged;
- return base.EndEdit();
- }
- protected override Telerik.WinControls.RadElement CreateEditorElement()
- {
- return new RadTrackBarElement();
- }
- public override Type DataType
- {
- get
- {
- return typeof(int);
- }
- }
-}
-````
-````VB.NET
-Public Sub New()
- InitializeComponent()
- Me.RadDataFilter1.DataSource = Me.ProductsBindingSource
- AddHandler Me.RadDataFilter1.EditorRequired, AddressOf radDataFilter1_EditorRequired
- AddHandler Me.RadDataFilter1.EditorInitialized, AddressOf radDataFilter1_EditorInitialized
- Me.RadDataFilter1.ItemHeight = 40
-End Sub
-Private Sub radDataFilter1_EditorInitialized(sender As Object, e As TreeNodeEditorInitializedEventArgs)
- Dim editor As TrackBarEditor = TryCast(e.Editor, TrackBarEditor)
- If editor IsNot Nothing Then
- Dim element As RadTrackBarElement = TryCast(editor.EditorElement, RadTrackBarElement)
- element.ShowTicks = True
- element.Maximum = 10
- End If
-End Sub
-Private Sub radDataFilter1_EditorRequired(sender As Object, e As TreeNodeEditorRequiredEventArgs)
- Dim filterNode As DataFilterCriteriaNode = TryCast(e.Node, DataFilterCriteriaNode)
- If filterNode IsNot Nothing AndAlso filterNode.PropertyName = "ProductID" AndAlso TypeOf sender Is DataFilterValueEditorElement Then
- e.EditorType = GetType(TrackBarEditor)
- End If
-End Sub
-Public Class TrackBarEditor
-Inherits BaseInputEditor
- Public Overrides Property Value() As Object
- Get
- Dim editor As RadTrackBarElement = DirectCast(Me.EditorElement, RadTrackBarElement)
- Return editor.Value
- End Get
- Set(value As Object)
- Dim editor As RadTrackBarElement = DirectCast(Me.EditorElement, RadTrackBarElement)
- If value IsNot Nothing AndAlso Not value.Equals(DBNull.Value) Then
- editor.Value = Convert.ToInt32(value)
- Else
- editor.Value = 0
- End If
- End Set
- End Property
- Public Overrides Sub BeginEdit()
- MyBase.BeginEdit()
- Me.EditorElement.Focus()
- AddHandler DirectCast(Me.EditorElement, RadTrackBarElement).ValueChanged, AddressOf TrackBarEditor_ValueChanged
- End Sub
- Private Sub TrackBarEditor_ValueChanged(sender As Object, e As EventArgs)
- Me.OnValueChanged()
- End Sub
- Public Overrides Function EndEdit() As Boolean
- RemoveHandler DirectCast(Me.EditorElement, RadTrackBarElement).ValueChanged, AddressOf TrackBarEditor_ValueChanged
- Return MyBase.EndEdit()
- End Function
- Protected Overrides Function CreateEditorElement() As Telerik.WinControls.RadElement
- Return New RadTrackBarElement()
- End Function
- Public Overrides ReadOnly Property DataType() As Type
- Get
- Return GetType(Integer)
- End Get
- End Property
-End Class
-
-````
-
-{{endregion}}
# See Also
diff --git a/controls/datafilter/editing/events.md b/controls/datafilter/editing/events.md
index 0ea781049..606c0adc2 100644
--- a/controls/datafilter/editing/events.md
+++ b/controls/datafilter/editing/events.md
@@ -47,74 +47,10 @@ The following code snippet demonstrates how to replace the default editor with a
#### Replace and customize the default editor
-{{source=..\SamplesCS\DataFilter\DataFilterEditing.cs region=CustomizeEditor}}
-{{source=..\SamplesVB\DataFilter\DataFilterEditing.vb region=CustomizeEditor}}
-
-````C#
-public DataFilterEditing()
-{
- InitializeComponent();
- this.radDataFilter1.DataSource = this.productsBindingSource;
- this.radDataFilter1.EditorRequired += radDataFilter1_EditorRequired;
- this.radDataFilter1.EditorInitialized += radDataFilter1_EditorInitialized;
-}
-private void radDataFilter1_EditorInitialized(object sender, TreeNodeEditorInitializedEventArgs e)
-{
- TreeViewDropDownListEditor editor = e.Editor as TreeViewDropDownListEditor;
- if (editor != null)
- {
- editor.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
- editor.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
- BaseDropDownListEditorElement el = editor.EditorElement as BaseDropDownListEditorElement;
- el.AutoCompleteMode = AutoCompleteMode.Suggest;
- }
-}
-private void radDataFilter1_EditorRequired(object sender, TreeNodeEditorRequiredEventArgs e)
-{
- DataFilterCriteriaNode filterNode = e.Node as DataFilterCriteriaNode;
- if (filterNode != null && filterNode.PropertyName == "CategoryID" && sender is DataFilterValueEditorElement)
- {
- TreeViewDropDownListEditor editor = new TreeViewDropDownListEditor();
- BaseDropDownListEditorElement el = editor.EditorElement as BaseDropDownListEditorElement;
- el.DataSource = this.categoriesBindingSource;
- el.ValueMember = "CategoryID";
- el.DisplayMember = "CategoryName";
- e.Editor = editor;
- }
-}
-
-````
-````VB.NET
-Public Sub New()
- InitializeComponent()
- Me.RadDataFilter1.DataSource = Me.ProductsBindingSource
- AddHandler Me.RadDataFilter1.EditorRequired, AddressOf radDataFilter1_EditorRequired
- AddHandler Me.RadDataFilter1.EditorInitialized, AddressOf radDataFilter1_EditorInitialized
-End Sub
-Private Sub radDataFilter1_EditorInitialized(sender As Object, e As TreeNodeEditorInitializedEventArgs)
- Dim editor As TreeViewDropDownListEditor = TryCast(e.Editor, TreeViewDropDownListEditor)
- If editor IsNot Nothing Then
- editor.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown
- editor.DropDownSizingMode = SizingMode.UpDownAndRightBottom
- Dim el As BaseDropDownListEditorElement = TryCast(editor.EditorElement, BaseDropDownListEditorElement)
- el.AutoCompleteMode = AutoCompleteMode.Suggest
- End If
-End Sub
-Private Sub radDataFilter1_EditorRequired(sender As Object, e As TreeNodeEditorRequiredEventArgs)
- Dim filterNode As DataFilterCriteriaNode = TryCast(e.Node, DataFilterCriteriaNode)
- If filterNode IsNot Nothing AndAlso filterNode.PropertyName = "CategoryID" AndAlso TypeOf sender Is DataFilterValueEditorElement Then
- Dim editor As New TreeViewDropDownListEditor()
- Dim el As BaseDropDownListEditorElement = TryCast(editor.EditorElement, BaseDropDownListEditorElement)
- el.DataSource = Me.CategoriesBindingSource
- el.ValueMember = "CategoryID"
- el.DisplayMember = "CategoryName"
- e.Editor = editor
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
### Check which element is being edited.
@@ -123,45 +59,10 @@ Both editors, field and filter type are TreeViewDropDownListEditor and if you ne
#### Determine which item is edited.
-{{source=..\SamplesCS\DataFilter\DataFilterEditing.cs region=EditorType}}
-{{source=..\SamplesVB\DataFilter\DataFilterEditing.vb region=EditorType}}
-````C#
-private void radDataFilter1_EditorInitialized1(object sender, TreeNodeEditorInitializedEventArgs e)
-{
- TreeViewDropDownListEditor editor = e.Editor as TreeViewDropDownListEditor;
- DataFilterCriteriaElement criteriaElement = e.NodeElement as DataFilterCriteriaElement;
- if (editor != null && criteriaElement != null)
- {
- if (criteriaElement.EditingElement is DataFilterFieldEditorElement)
- {
- //the field is edited
- }
- if (criteriaElement.EditingElement is DataFilterOperatorEditorElement)
- {
- // the filter type is edited
- }
- }
-}
-
-````
-````VB.NET
-Private Sub radDataFilter1_EditorInitialized1(ByVal sender As Object, ByVal e As TreeNodeEditorInitializedEventArgs)
- Dim editor As TreeViewDropDownListEditor = TryCast(e.Editor, TreeViewDropDownListEditor)
- Dim criteriaElement As DataFilterCriteriaElement = TryCast(e.NodeElement, DataFilterCriteriaElement)
- If editor IsNot Nothing AndAlso criteriaElement IsNot Nothing Then
- If TypeOf criteriaElement.EditingElement Is DataFilterFieldEditorElement Then
- 'the field is edited
- End If
- If TypeOf criteriaElement.EditingElement Is DataFilterOperatorEditorElement Then
- ' the filter type is edited
- End If
- End If
-End Sub
-
-````
-
-
-{{endregion}}
+
+
+
+
## Edited
diff --git a/controls/datafilter/getting-started.md b/controls/datafilter/getting-started.md
index 5c188b420..298ca6018 100644
--- a/controls/datafilter/getting-started.md
+++ b/controls/datafilter/getting-started.md
@@ -50,31 +50,10 @@ At this point your form should look like this:
4\. When the user adds his filtering criteria, the control automatically produces a filter expression available in its Expression property. To apply this filter to the underlying BindingSource, the __ApplyFilter__ method should be invoked. We can use the control events to call the method when new filter is added by the user for example when an item is applied and when removed. Since the RadDataFilter control is build on top of RadTreeView we can use the NodeRemoved and the Edited events for the purpose.
-{{source=..\SamplesCS\DataFilter\DataFilterGettingStarted.cs region=Events}}
-{{source=..\SamplesVB\DataFilter\DataFilterGettingStarted.vb region=Events}}
-````C#
-private void RadDataFilter1_NodeRemoved(object sender, RadTreeViewEventArgs e)
-{
- radDataFilter1.ApplyFilter();
-}
-private void RadDataFilter1_Edited(object sender, TreeNodeEditedEventArgs e)
-{
- radDataFilter1.ApplyFilter();
-}
-
-````
-````VB.NET
-Private Sub RadDataFilter1_NodeRemoved(ByVal sender As Object, ByVal e As RadTreeViewEventArgs)
- RadDataFilter1.ApplyFilter()
-End Sub
-Private Sub RadDataFilter1_Edited(ByVal sender As Object, ByVal e As TreeNodeEditedEventArgs)
- RadDataFilter1.ApplyFilter()
-End Sub
-
-````
-
-
-{{endregion}}
+
+
+
+
5\. Start the application and add some filters.
diff --git a/controls/datafilter/localization/localization.md b/controls/datafilter/localization/localization.md
index d38c331b4..066b16982 100644
--- a/controls/datafilter/localization/localization.md
+++ b/controls/datafilter/localization/localization.md
@@ -22,192 +22,19 @@ Below is a sample implementation of an English localization provider:
#### Localizing RadDataFilter Strings
-{{source=..\SamplesCS\DataFilter\DataFilterLocalization.cs region=MyLocalizationProvider}}
-{{source=..\SamplesVB\DataFilter\DataFilterLocalization.vb region=MyLocalizationProvider}}
-````C#
-
-public class EnglishDataFilterLocalizationProvider : Telerik.WinControls.UI.DataFilterLocalizationProvider
-{
- public override string GetLocalizedString(string id)
- {
- switch (id)
- {
- case DataFilterStringId.LogicalOperatorAnd:
- return "All";
- case DataFilterStringId.LogicalOperatorOr:
- return "Any";
- case DataFilterStringId.LogicalOperatorDescription:
- return " of the following are true";
-
- case DataFilterStringId.FieldNullText:
- return "Choose field";
- case DataFilterStringId.ValueNullText:
- return "Enter a value";
-
- case DataFilterStringId.AddNewButtonText:
- return "Add";
- case DataFilterStringId.AddNewButtonExpression:
- return "Expression";
- case DataFilterStringId.AddNewButtonGroup:
- return "Group";
-
- case DataFilterStringId.DialogTitle:
- return "Data Filter";
- case DataFilterStringId.DialogOKButton:
- return "OK";
- case DataFilterStringId.DialogCancelButton:
- return "Cancel";
- case DataFilterStringId.DialogApplyButton:
- return "Apply";
-
- case DataFilterStringId.ErrorAddNodeDialogTitle:
- return "RadDataFilter Error";
- case DataFilterStringId.ErrorAddNodeDialogText:
- return "Cannot add entries to the control - missing property descriptors. \nDataSource is not set and/or DataFilterDescriptorItems are not added to the Descriptors collection of the control.";
-
- case DataFilterStringId.FilterFunctionBetween:
- return "Between";
- case DataFilterStringId.FilterFunctionContains:
- return "Contains";
- case DataFilterStringId.FilterFunctionDoesNotContain:
- return "Does not contain";
- case DataFilterStringId.FilterFunctionEndsWith:
- return "Ends with";
- case DataFilterStringId.FilterFunctionEqualTo:
- return "Equals";
- case DataFilterStringId.FilterFunctionGreaterThan:
- return "Greater than";
- case DataFilterStringId.FilterFunctionGreaterThanOrEqualTo:
- return "Greater than or equal to";
- case DataFilterStringId.FilterFunctionIsEmpty:
- return "Is empty";
- case DataFilterStringId.FilterFunctionIsNull:
- return "Is null";
- case DataFilterStringId.FilterFunctionLessThan:
- return "Less than";
- case DataFilterStringId.FilterFunctionLessThanOrEqualTo:
- return "Less than or equal to";
- case DataFilterStringId.FilterFunctionNoFilter:
- return "No filter";
- case DataFilterStringId.FilterFunctionIsContainedIn:
- return "Is in list";
- case DataFilterStringId.FilterFunctionIsNotContainedIn:
- return "Not in list";
- case DataFilterStringId.FilterFunctionNotBetween:
- return "Not between";
- case DataFilterStringId.FilterFunctionNotEqualTo:
- return "Not equal to";
- case DataFilterStringId.FilterFunctionNotIsEmpty:
- return "Is not empty";
- case DataFilterStringId.FilterFunctionNotIsNull:
- return "Is not null";
- case DataFilterStringId.FilterFunctionStartsWith:
- return "Starts with";
- case DataFilterStringId.FilterFunctionCustom:
- return "Custom";
- }
- return base.GetLocalizedString(id);
- }
-
-````
-````VB.NET
-Public Class EnglishDataFilterLocalizationProvider
-Inherits Telerik.WinControls.UI.DataFilterLocalizationProvider
- Public Overrides Function GetLocalizedString(id As String) As String
- Select Case id
- Case DataFilterStringId.LogicalOperatorAnd
- Return "All"
- Case DataFilterStringId.LogicalOperatorOr
- Return "Any"
- Case DataFilterStringId.LogicalOperatorDescription
- Return " of the following are true"
- Case DataFilterStringId.FieldNullText
- Return "Choose field"
- Case DataFilterStringId.ValueNullText
- Return "Enter a value"
- Case DataFilterStringId.AddNewButtonText
- Return "Add"
- Case DataFilterStringId.AddNewButtonExpression
- Return "Expression"
- Case DataFilterStringId.AddNewButtonGroup
- Return "Group"
- Case DataFilterStringId.DialogTitle
- Return "Data Filter"
- Case DataFilterStringId.DialogOKButton
- Return "OK"
- Case DataFilterStringId.DialogCancelButton
- Return "Cancel"
- Case DataFilterStringId.DialogApplyButton
- Return "Apply"
- Case DataFilterStringId.ErrorAddNodeDialogTitle
- Return "RadDataFilter Error"
- Case DataFilterStringId.ErrorAddNodeDialogText
- Return "Cannot add entries to the control - missing property descriptors. " & vbLf & "DataSource is not set and/or DataFilterDescriptorItems are not added to the Descriptors collection of the control."
- Case DataFilterStringId.FilterFunctionBetween
- Return "Between"
- Case DataFilterStringId.FilterFunctionContains
- Return "Contains"
- Case DataFilterStringId.FilterFunctionDoesNotContain
- Return "Does not contain"
- Case DataFilterStringId.FilterFunctionEndsWith
- Return "Ends with"
- Case DataFilterStringId.FilterFunctionEqualTo
- Return "Equals"
- Case DataFilterStringId.FilterFunctionGreaterThan
- Return "Greater than"
- Case DataFilterStringId.FilterFunctionGreaterThanOrEqualTo
- Return "Greater than or equal to"
- Case DataFilterStringId.FilterFunctionIsEmpty
- Return "Is empty"
- Case DataFilterStringId.FilterFunctionIsNull
- Return "Is null"
- Case DataFilterStringId.FilterFunctionLessThan
- Return "Less than"
- Case DataFilterStringId.FilterFunctionLessThanOrEqualTo
- Return "Less than or equal to"
- Case DataFilterStringId.FilterFunctionNoFilter
- Return "No filter"
- Case DataFilterStringId.FilterFunctionIsContainedIn
- Return "Is in list"
- Case DataFilterStringId.FilterFunctionIsNotContainedIn
- Return "Not in list"
- Case DataFilterStringId.FilterFunctionNotBetween
- Return "Not between"
- Case DataFilterStringId.FilterFunctionNotEqualTo
- Return "Not equal to"
- Case DataFilterStringId.FilterFunctionNotIsEmpty
- Return "Is not empty"
- Case DataFilterStringId.FilterFunctionNotIsNull
- Return "Is not null"
- Case DataFilterStringId.FilterFunctionStartsWith
- Return "Starts with"
- Case DataFilterStringId.FilterFunctionCustom
- Return "Custom"
- End Select
- Return MyBase.GetLocalizedString(id)
- End Function
-
-````
-
-{{endregion}}
+
+
+
+
To apply the custom localization provider, instantiate and assign it to the current localization provider:
#### Assigning the Current Localization Provider
-{{source=..\SamplesCS\DataFilter\DataFilterLocalization.cs region=ApplyLocalizationProvider}}
-{{source=..\SamplesVB\DataFilter\DataFilterLocalization.vb region=ApplyLocalizationProvider}}
-````C#
-
-DataFilterLocalizationProvider.CurrentProvider = new EnglishDataFilterLocalizationProvider();
-
-````
-````VB.NET
-DataFilterLocalizationProvider.CurrentProvider = New EnglishDataFilterLocalizationProvider()
-
-````
+
+
-{{endregion}}
+
The code provided above illustrates the approach to be used to localize the **RadDataFilter** and is not intended as a full translation.
diff --git a/controls/datafilter/save-load-filters.md b/controls/datafilter/save-load-filters.md
index 3e912a836..ba1cfdf11 100644
--- a/controls/datafilter/save-load-filters.md
+++ b/controls/datafilter/save-load-filters.md
@@ -13,48 +13,18 @@ position: 11
You can use the __SaveXML__ and __LoadXml__ methods to save the current expression either in a file or in a stream. The following snippets are showing how you can save or load the current state.
#### SaveXML
-{{source=..\SamplesCS\DataFilter\DataFilterGettingStarted.cs region=Save}}
-{{source=..\SamplesVB\DataFilter\DataFilterGettingStarted.vb region=Save}}
-````C#
-private void radButton1_Click(object sender, EventArgs e)
-{
- radDataFilter1.SaveXML("Test.xml");
-}
+
+
-````
-````VB.NET
-Private Sub radButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
- RadDataFilter1.SaveXML("Test.xml")
-End Sub
-````
-
-
-
-{{endregion}}
#### LoadXML
-{{source=..\SamplesCS\DataFilter\DataFilterGettingStarted.cs region=Load}}
-{{source=..\SamplesVB\DataFilter\DataFilterGettingStarted.vb region=Load}}
-````C#
-private void radButton2_Click(object sender, EventArgs e)
-{
- radDataFilter1.LoadXML("Test.xml");
-}
-
-````
-````VB.NET
-Private Sub radButton2_Click(ByVal sender As Object, ByVal e As EventArgs)
- RadDataFilter1.LoadXML("Test.xml")
-End Sub
-
-````
-
+
+
-{{endregion}}
diff --git a/controls/datafilter/working-with-descriptor-items/data-binding.md b/controls/datafilter/working-with-descriptor-items/data-binding.md
index ef95cb04c..eaad998db 100644
--- a/controls/datafilter/working-with-descriptor-items/data-binding.md
+++ b/controls/datafilter/working-with-descriptor-items/data-binding.md
@@ -38,27 +38,10 @@ It is possible to set the **DataSource** property programmatically as well.
#### Setting DataSource at run time
-{{source=..\SamplesCS\DataFilter\DataFilterGettingStarted.cs region=BoundMode}}
-{{source=..\SamplesVB\DataFilter\DataFilterGettingStarted.vb region=BoundMode}}
-
-````C#
-DataTable dt = new DataTable();
-dt.Columns.Add("Id", typeof(int));
-dt.Columns.Add("Name", typeof(string));
-dt.Columns.Add("IsActive", typeof(bool));
-this.radDataFilter1.DataSource = dt;
-
-````
-````VB.NET
-Dim dt As New DataTable()
-dt.Columns.Add("Id", GetType(Integer))
-dt.Columns.Add("Name", GetType(String))
-dt.Columns.Add("IsActive", GetType(Boolean))
-Me.RadDataFilter1.DataSource = dt
-
-````
-
-{{endregion}}
+
+
+
+
After setting the **DataSource** property, the **Descriptors** collection is filled with the respective fields. Then, you can apply the desired filter either by setting the **Expression** property or by using the UI at run time.
diff --git a/controls/datafilter/working-with-descriptor-items/descriptor-items.md b/controls/datafilter/working-with-descriptor-items/descriptor-items.md
index fb33364b2..b4ef87952 100644
--- a/controls/datafilter/working-with-descriptor-items/descriptor-items.md
+++ b/controls/datafilter/working-with-descriptor-items/descriptor-items.md
@@ -63,35 +63,10 @@ The *RadItem Collection Editor* that allows you to edit the items at design time
The following snippet shows how you can add __DataFilterComboDescriptorItem__ in the code:
-{{source=..\SamplesCS\DataFilter\DataFilterEditing.cs region=AddComboItem}}
-{{source=..\SamplesVB\DataFilter\DataFilterEditing.vb region=AddComboItem}}
-````C#
-DataFilterComboDescriptorItem item1 = new DataFilterComboDescriptorItem();
-item1.DescriptorName = "Item Type";
-item1.DescriptorType = typeof(int);
-item1.DataSource = GetTable();
-item1.ValueMember = "ID";
-item1.DisplayMember = "Type";
-item1.DropDownStyle = RadDropDownStyle.DropDown;
-item1.AutoCompleteMode = AutoCompleteMode.Suggest;
-radDataFilter1.Descriptors.Add(item1);
-
-````
-````VB.NET
-Dim item1 As New DataFilterComboDescriptorItem()
-item1.DescriptorName = "Item Type"
-item1.DescriptorType = GetType(Integer)
-item1.DataSource = GetTable()
-item1.ValueMember = "ID"
-item1.DisplayMember = "Type"
-item1.DropDownStyle = RadDropDownStyle.DropDown
-item1.AutoCompleteMode = AutoCompleteMode.Suggest
-RadDataFilter1.Descriptors.Add(item1)
-
-````
-
-
-{{endregion}}
+
+
+
+
When this is done you can add new expression item and choose from the list:
diff --git a/controls/datafilter/working-with-descriptor-items/unbound-mode.md b/controls/datafilter/working-with-descriptor-items/unbound-mode.md
index 71f9bc89c..4061ee5d6 100644
--- a/controls/datafilter/working-with-descriptor-items/unbound-mode.md
+++ b/controls/datafilter/working-with-descriptor-items/unbound-mode.md
@@ -22,34 +22,10 @@ You can add/remove/modify **DataFilterDescriptorItems** by using the *RadItem Co
#### Adding descriptor items programmatically and applying an expression
-{{source=..\SamplesCS\DataFilter\DataFilterGettingStarted.cs region=UnboundMode}}
-{{source=..\SamplesVB\DataFilter\DataFilterGettingStarted.vb region=UnboundMode}}
-````C#
-DataFilterDescriptorItem nameDescriptorItem = new DataFilterDescriptorItem();
-nameDescriptorItem.DescriptorName = "ProductName";
-nameDescriptorItem.DescriptorType = typeof(string);
-this.radDataFilter1.Descriptors.Add(nameDescriptorItem);
-DataFilterDescriptorItem priceDescriptorItem = new DataFilterDescriptorItem();
-priceDescriptorItem.DescriptorName = "UnitPrice";
-priceDescriptorItem.DescriptorType = typeof(decimal);
-this.radDataFilter1.Descriptors.Add(priceDescriptorItem);
-this.radDataFilter1.Expression = "([ProductName] LIKE '%ch%' OR [UnitPrice] > '15')";
-
-````
-````VB.NET
-Dim nameDescriptorItem As New DataFilterDescriptorItem()
-nameDescriptorItem.DescriptorName = "ProductName"
-nameDescriptorItem.DescriptorType = GetType(String)
-Me.RadDataFilter1.Descriptors.Add(nameDescriptorItem)
-Dim priceDescriptorItem As New DataFilterDescriptorItem()
-priceDescriptorItem.DescriptorName = "UnitPrice"
-priceDescriptorItem.DescriptorType = GetType(Decimal)
-Me.RadDataFilter1.Descriptors.Add(priceDescriptorItem)
-Me.RadDataFilter1.Expression = "([ProductName] LIKE '%ch%' OR [UnitPrice] > '15')"
-
-````
-
-{{endregion}}
+
+
+
+

diff --git a/controls/datalayout/change-the-editor-to-a-bound-raddropdownlist.md b/controls/datalayout/change-the-editor-to-a-bound-raddropdownlist.md
index f19427ac2..6a2797532 100644
--- a/controls/datalayout/change-the-editor-to-a-bound-raddropdownlist.md
+++ b/controls/datalayout/change-the-editor-to-a-bound-raddropdownlist.md
@@ -19,321 +19,45 @@ This article will walk you through the process of changing the default editor to
1\. First you can subscribe to the __BindingCreating__, __BindingCreated__ and __EditorInitializing__ events of __RadDataLayout__ (please note that this should be done before the control has been bound).
-{{source=..\SamplesCS\DataLayout\DataLayoutChangeEditor.cs region=subscribe}}
-{{source=..\SamplesVB\DataLayout\DataLayoutChangeEditor.vb region=subscribe}}
+
+
-````C#
-this.radDataLayout1.EditorInitializing += radDataLayout1_EditorInitializing;
-this.radDataLayout1.BindingCreating += radDataLayout1_BindingCreating;
-this.radDataLayout1.BindingCreated += radDataLayout1_BindingCreated;
-this.radDataLayout1.DataSource = productsBinding;
-````
-````VB.NET
-AddHandler Me.RadDataLayout1.EditorInitializing, AddressOf radDataLayout1_EditorInitializing
-AddHandler Me.RadDataLayout1.BindingCreating, AddressOf radDataLayout1_BindingCreating
-AddHandler Me.RadDataLayout1.BindingCreated, AddressOf radDataLayout1_BindingCreated
-Me.RadDataLayout1.DataSource = productsBinding
-
-````
-
-{{endregion}}
2\. In the __EditorInitializing__ event handler, you will be able to change the automatically generated editor with a __RadDropDownList__. In addition, you should set it up as needed. In this case we will set the __DataSource__, __DisplayMember__ and __ValueMember__ properties.
-{{source=..\SamplesCS\DataLayout\DataLayoutChangeEditor.cs region=editor}}
-{{source=..\SamplesVB\DataLayout\DataLayoutChangeEditor.vb region=editor}}
-
-````C#
-RadDropDownList radDropDownList1;
-void radDataLayout1_EditorInitializing(object sender, Telerik.WinControls.UI.EditorInitializingEventArgs e)
-{
- if (e.Property.Name == "SupplierID")
- {
- radDropDownList1 = new RadDropDownList();
- radDropDownList1.DataSource = suplierList;
- radDropDownList1.ValueMember = "SupplierID";
- radDropDownList1.DisplayMember = "CompanyName";
- e.Editor = radDropDownList1;
- }
-}
-
-````
-````VB.NET
-Private radDropDownList1 As RadDropDownList
-Private Sub radDataLayout1_EditorInitializing(sender As Object, e As Telerik.WinControls.UI.EditorInitializingEventArgs)
- If e.[Property].Name = "SupplierID" Then
- radDropDownList1 = New RadDropDownList()
- radDropDownList1.DataSource = suplierList
- radDropDownList1.ValueMember = "SupplierID"
- radDropDownList1.DisplayMember = "CompanyName"
- e.Editor = radDropDownList1
- End If
-End Sub
+
+
-````
-
-{{endregion}}
3\. In order the values to be synchronized correctly, the bound property should be set in the __BindingCreating__ event handler. In this case it should be set to the __SelectedValue__ property.
-{{source=..\SamplesCS\DataLayout\DataLayoutChangeEditor.cs region=creating}}
-{{source=..\SamplesVB\DataLayout\DataLayoutChangeEditor.vb region=creating}}
-
-````C#
-void radDataLayout1_BindingCreating(object sender, Telerik.WinControls.UI.BindingCreatingEventArgs e)
-{
- if (e.DataMember == "SupplierID")
- {
- e.PropertyName = "SelectedValue";
- }
-}
-
-````
-````VB.NET
-Private Sub radDataLayout1_BindingCreating(sender As Object, e As Telerik.WinControls.UI.BindingCreatingEventArgs)
- If e.DataMember = "SupplierID" Then
- e.PropertyName = "SelectedValue"
- End If
-End Sub
+
+
-````
-{{endregion}}
4\. When the data source is using nullable values in order the user to be able to change the current value via the drop down list, the result value should be manually parsed. This can be done in the binding's __Parse__ event. You can subscribe to this event in the __BindingCreated__ event handler (in order this event to fire the formatting should be enabled).
-{{source=..\SamplesCS\DataLayout\DataLayoutChangeEditor.cs region=created}}
-{{source=..\SamplesVB\DataLayout\DataLayoutChangeEditor.vb region=created}}
+
+
-````C#
-void radDataLayout1_BindingCreated(object sender, BindingCreatedEventArgs e)
-{
- if (e.DataMember == "SupplierID")
- {
- e.Binding.FormattingEnabled = true;
- e.Binding.Parse += new ConvertEventHandler(Binding_Parse);
- }
-}
-
-private void Binding_Parse(object sender, ConvertEventArgs e)
-{
- int tmpvalue;
- int? result = int.TryParse(e.Value.ToString(), out tmpvalue) ? tmpvalue : (int?)null;
- e.Value = result;
-}
-````
-````VB.NET
-Private Sub radDataLayout1_BindingCreated(sender As Object, e As BindingCreatedEventArgs)
- If e.DataMember = "SupplierID" Then
- e.Binding.FormattingEnabled = True
- AddHandler e.Binding.Parse, AddressOf Binding_Parse
- End If
-End Sub
-Private Sub Binding_Parse(sender As Object, e As ConvertEventArgs)
- Dim tmpvalue As Integer
- Dim result As System.Nullable(Of Integer) = If(Integer.TryParse(e.Value.ToString(), tmpvalue), tmpvalue, DirectCast(Nothing, System.Nullable(Of Integer)))
- e.Value = result
-End Sub
-
-````
-
-{{endregion}}
To make the example complete you can use the following classes.
-{{source=..\SamplesCS\DataLayout\DataLayoutChangeEditor.cs region=data}}
-{{source=..\SamplesVB\DataLayout\DataLayoutChangeEditor.vb region=data}}
-
-````C#
-public class ProductModel
-{
- private int? _supplierID;
- private string _productName;
- public ProductModel(int? supplierID, string productName)
- {
- this._supplierID = supplierID;
- this._productName = productName;
- }
- public int? SupplierID
- {
- get
- {
- return this._supplierID;
- }
- set
- {
- this._supplierID = value;
- }
- }
- public string ProductName
- {
- get
- {
- return this._productName;
- }
- set
- {
- this._productName = value;
- }
- }
-}
-public partial class SupplierModel
-{
- private int? _supplierID;
- private string _companyName;
- public SupplierModel(int? supplierID, string companyName)
- {
- this._supplierID = supplierID;
- this._companyName = companyName;
- }
- public int? SupplierID
- {
- get
- {
- return this._supplierID;
- }
- set
- {
- this._supplierID = value;
- }
- }
- public string CompanyName
- {
- get
- {
- return this._companyName;
- }
- set
- {
- this._companyName = value;
- }
- }
-}
+
+
-````
-````VB.NET
-Public Class ProductModel
- Private _supplierID As System.Nullable(Of Integer)
- Private _productName As String
- Public Sub New(supplierID As System.Nullable(Of Integer), productName As String)
- Me._supplierID = supplierID
- Me._productName = productName
- End Sub
- Public Property SupplierID() As System.Nullable(Of Integer)
- Get
- Return Me._supplierID
- End Get
- Set(value As System.Nullable(Of Integer))
- Me._supplierID = value
- End Set
- End Property
- Public Property ProductName() As String
- Get
- Return Me._productName
- End Get
- Set(value As String)
- Me._productName = value
- End Set
- End Property
-End Class
-Partial Public Class SupplierModel
- Private _supplierID As System.Nullable(Of Integer)
- Private _companyName As String
- Public Sub New(supplierID As System.Nullable(Of Integer), companyName As String)
- Me._supplierID = supplierID
- Me._companyName = companyName
- End Sub
- Public Property SupplierID() As System.Nullable(Of Integer)
- Get
- Return Me._supplierID
- End Get
- Set(value As System.Nullable(Of Integer))
- Me._supplierID = value
- End Set
- End Property
- Public Property CompanyName() As String
- Get
- Return Me._companyName
- End Get
- Set(value As String)
- Me._companyName = value
- End Set
- End Property
-End Class
-````
-
-{{endregion}}
You can initialize the data sources in the Form’s constructor.
-{{source=..\SamplesCS\DataLayout\DataLayoutChangeEditor.cs region=init}}
-{{source=..\SamplesVB\DataLayout\DataLayoutChangeEditor.vb region=init}}
-
-````C#
-List productList;
-List suplierList;
-BindingSource productsBinding;
-public DataLayoutChangeEditor()
-{
- InitializeComponent();
- productList = new List();
- suplierList = new List();
- productList.Add(new ProductModel(1, "Chai"));
- productList.Add(new ProductModel(2, "Chang"));
- productList.Add(new ProductModel(3, "Aniseed Syrup"));
- productList.Add(new ProductModel(4, "Chef Anton's Gumbo Mix"));
- productList.Add(new ProductModel(5, "Tofu"));
- productList.Add(new ProductModel(null, "Sir Rodney's Marmalade"));
- productList.Add(new ProductModel(6, "Boston Crab Meat"));
- productList.Add(new ProductModel(5, "Chartreuse verte"));
- productList.Add(new ProductModel(2, "Ravioli Angelo"));
- productList.Add(new ProductModel(4, "Perth Pasties"));
- suplierList.Add(new SupplierModel(1, "Exotic Liquids"));
- suplierList.Add(new SupplierModel(2, "New Orleans Cajun Delights"));
- suplierList.Add(new SupplierModel(3, "Tokyo Traders"));
- suplierList.Add(new SupplierModel(4, "Norske Meierier"));
- suplierList.Add(new SupplierModel(5, "New England Seafood Cannery"));
- suplierList.Add(new SupplierModel(6, "Leka Trading"));
- productsBinding = new BindingSource();
- productsBinding.DataSource = productList;
-}
-
-````
-````VB.NET
-Private productList As List(Of ProductModel)
-Private suplierList As List(Of SupplierModel)
-Private productsBinding As BindingSource
-Public Sub New()
- InitializeComponent()
- productList = New List(Of ProductModel)()
- suplierList = New List(Of SupplierModel)()
- productList.Add(New ProductModel(1, "Chai"))
- productList.Add(New ProductModel(2, "Chang"))
- productList.Add(New ProductModel(3, "Aniseed Syrup"))
- productList.Add(New ProductModel(4, "Chef Anton's Gumbo Mix"))
- productList.Add(New ProductModel(5, "Tofu"))
- productList.Add(New ProductModel(Nothing, "Sir Rodney's Marmalade"))
- productList.Add(New ProductModel(6, "Boston Crab Meat"))
- productList.Add(New ProductModel(5, "Chartreuse verte"))
- productList.Add(New ProductModel(2, "Ravioli Angelo"))
- productList.Add(New ProductModel(4, "Perth Pasties"))
- suplierList.Add(New SupplierModel(1, "Exotic Liquids"))
- suplierList.Add(New SupplierModel(2, "New Orleans Cajun Delights"))
- suplierList.Add(New SupplierModel(3, "Tokyo Traders"))
- suplierList.Add(New SupplierModel(4, "Norske Meierier"))
- suplierList.Add(New SupplierModel(5, "New England Seafood Cannery"))
- suplierList.Add(New SupplierModel(6, "Leka Trading"))
- productsBinding = New BindingSource()
- productsBinding.DataSource = productList
-End Sub
+
+
-````
-{{endregion}}
# See Also
diff --git a/controls/datalayout/customizing-appearance/customizing-appearance.md b/controls/datalayout/customizing-appearance/customizing-appearance.md
index 3f2abc733..8f3b24085 100644
--- a/controls/datalayout/customizing-appearance/customizing-appearance.md
+++ b/controls/datalayout/customizing-appearance/customizing-appearance.md
@@ -21,30 +21,10 @@ You can access and modify the style for different elements in __RadDataEntry__ b
The following snippet shows how you access the underlying controls and change their style:
-{{source=..\SamplesCS\DataLayout\PropertiesEventsAttributesForm.cs region=FormatItems}}
-{{source=..\SamplesVB\DataLayout\PropertiesEventsAttributesForm.vb region=FormatItems}}
-````C#
-foreach (DataLayoutControlItem item in radDataLayout1.LayoutControl.Items)
-{
- item.ForeColor = ColorTranslator.FromHtml("#51ab2e");
- if (item.AssociatedControl is RadTextBox)
- {
- item.AssociatedControl.BackColor = ColorTranslator.FromHtml("#91c930");
- }
-}
-
-````
-````VB.NET
-For Each item As DataLayoutControlItem In RadDataLayout1.LayoutControl.Items
- item.ForeColor = ColorTranslator.FromHtml("#51ab2e")
- If TypeOf item.AssociatedControl Is RadTextBox Then
- item.AssociatedControl.BackColor = ColorTranslator.FromHtml("#91c930")
- End If
-Next item
-
-````
-
-{{endregion}}
+
+
+
+
>caption Figure 2: Change the items styles
diff --git a/controls/datalayout/getting-started.md b/controls/datalayout/getting-started.md
index aeeea1950..92160c132 100644
--- a/controls/datalayout/getting-started.md
+++ b/controls/datalayout/getting-started.md
@@ -44,123 +44,24 @@ The Telerik UI for WinForms assemblies can be install by using one of the availa
2\. Let`s define the layout of our data control.
-{{source=..\SamplesCS\DataLayout\GettingStartedForm.cs region=DefineLayout}}
-{{source=..\SamplesVB\DataLayout\GettingStartedForm.vb region=DefineLayout}}
+
+
-````C#
-this.radDataLayout1.ItemDefaultHeight = 26;
-this.radDataLayout1.ColumnCount = 2;
-this.radDataLayout1.FlowDirection = FlowDirection.TopDown;
-this.radDataLayout1.AutoSizeLabels = true;
-````
-````VB.NET
-Me.RadDataLayout1.ItemDefaultHeight = 26
-Me.RadDataLayout1.ColumnCount = 2
-Me.RadDataLayout1.FlowDirection = FlowDirection.TopDown
-Me.RadDataLayout1.AutoSizeLabels = True
-````
+3\. A sample *Employee* class exposing several properties is going to be our model.
-{{endregion}}
+
+
-3\. A sample *Employee* class exposing several properties is going to be our model.
-{{source=..\SamplesCS\DataLayout\GettingStartedForm.cs region=EmployeeModel}}
-{{source=..\SamplesVB\DataLayout\GettingStartedForm.vb region=EmployeeModel}}
-
-````C#
-public class Employee
-{
- public string FirstName { get; set; }
- public string LastName { get; set; }
- public string Occupation { get; set; }
- public DateTime StartingDate { get; set; }
- public bool IsMarried { get; set; }
-}
-
-````
-````VB.NET
-Public Class EmployeeModel
- Public Property FirstName() As String
- Get
- Return m_FirstName
- End Get
- Set(value As String)
- m_FirstName = value
- End Set
- End Property
- Private m_FirstName As String
- Public Property LastName() As String
- Get
- Return m_LastName
- End Get
- Set(value As String)
- m_LastName = value
- End Set
- End Property
- Private m_LastName As String
- Public Property Occupation() As String
- Get
- Return m_Occupation
- End Get
- Set(value As String)
- m_Occupation = value
- End Set
- End Property
- Private m_Occupation As String
- Public Property StartingDate() As DateTime
- Get
- Return m_StartingDate
- End Get
- Set(value As DateTime)
- m_StartingDate = value
- End Set
- End Property
- Private m_StartingDate As DateTime
- Public Property IsMarried() As Boolean
- Get
- Return m_IsMarried
- End Get
- Set(value As Boolean)
- m_IsMarried = value
- End Set
- End Property
- Private m_IsMarried As Boolean
-End Class
-
-````
-
-{{endregion}}
4\. Once the **Employee** class is defined, you may use it to create an object of this type and bind it to the __RadDataLayout__ control:
-{{source=..\SamplesCS\DataLayout\GettingStartedForm.cs region=BindSingleObject}}
-{{source=..\SamplesVB\DataLayout\GettingStartedForm.vb region=BindSingleObject}}
-
-````C#
-this.radDataLayout1.DataSource = new Employee()
-{
- FirstName = "Sarah",
- LastName = "Blake",
- Occupation = "Supplied Manager",
- StartingDate = new DateTime(2005, 04, 12),
- IsMarried = true
-};
-
-````
-````VB.NET
-Me.RadDataLayout1.DataSource = New EmployeeModel() With {
- .FirstName = "Sarah",
- .LastName = "Blake",
- .Occupation = "Supplied Manager",
- .StartingDate = New DateTime(2005, 4, 12),
- .IsMarried = True
-}
-
-````
-
-{{endregion}}
+
+
+
+
5\. Press __F5__ to run the project and you should see the following:
@@ -178,85 +79,10 @@ Besides a __RadDataLayout__ we are also going to need a __RadBindingNavigator__
Compared to the previously shown example only the data binding is different. This time we are going to bind the __RadDataLayout__ control to a list of our model objects. The same list will also provide data to the **BindingSource** component.
-{{source=..\SamplesCS\DataLayout\GettingStartedForm.cs region=BindMultipleObjects}}
-{{source=..\SamplesVB\DataLayout\GettingStartedForm.vb region=BindMultipleObjects}}
-
-````C#
-List employees = new List();
-employees.Add(new Employee()
-{
- FirstName = "Sarah",
- LastName = "Blake",
- Occupation = "Supplied Manager",
- StartingDate = new DateTime(2005, 04, 12),
- IsMarried = true
-});
-employees.Add(new Employee()
-{
- FirstName = "Jane",
- LastName = "Simpson",
- Occupation = "Security",
- StartingDate = new DateTime(2008, 12, 03),
- IsMarried = true
-});
-employees.Add(new Employee()
-{
- FirstName = "John",
- LastName = "Peterson",
- Occupation = "Consultant",
- StartingDate = new DateTime(2005, 04, 12),
- IsMarried = false
-});
-employees.Add(new Employee()
-{
- FirstName = "Peter",
- LastName = "Bush",
- Occupation = "Cashier",
- StartingDate = new DateTime(2005, 04, 12),
- IsMarried = true
-});
-this.bindingSource1.DataSource = employees;
-this.radDataLayout1.DataSource = this.bindingSource1;
-this.radBindingNavigator1.BindingSource = this.bindingSource1;
-
-````
-````VB.NET
-Dim employees As New List(Of EmployeeModel)()
-employees.Add(New EmployeeModel() With {
- .FirstName = "Sarah",
- .LastName = "Blake",
- .Occupation = "Supplied Manager",
- .StartingDate = New DateTime(2005, 4, 12),
- .IsMarried = True
-})
-employees.Add(New EmployeeModel() With {
- .FirstName = "Jane",
- .LastName = "Simpson",
- .Occupation = "Security",
- .StartingDate = New DateTime(2008, 12, 3),
- .IsMarried = True
-})
-employees.Add(New EmployeeModel() With {
- .FirstName = "John",
- .LastName = "Peterson",
- .Occupation = "Consultant",
- .StartingDate = New DateTime(2005, 4, 12),
- .IsMarried = False
-})
-employees.Add(New EmployeeModel() With {
- .FirstName = "Peter",
- .LastName = "Bush",
- .Occupation = "Cashier",
- .StartingDate = New DateTime(2005, 4, 12),
- .IsMarried = True
-})
-Me.BindingSource1.DataSource = employees
-Me.RadDataLayout1.DataSource = Me.BindingSource1
-Me.RadBindingNavigator1.BindingSource = Me.BindingSource1
-
-````
-
-{{endregion}}
+
+
+
+
Press __F5__ to run the project and you should see the following:
diff --git a/controls/datalayout/localization.md b/controls/datalayout/localization.md
index ab654fd9a..fd7065cb3 100644
--- a/controls/datalayout/localization.md
+++ b/controls/datalayout/localization.md
@@ -1,163 +1,45 @@
----
-title: Localization
-page_title: Localization - WinForms DataLayout Control
-description: learn how you can localize the string used in WinForms DataLayout.
-slug: winforms/datalayout/localization
-tags: localization
-published: True
-position: 8
-previous_url: datalayout-localization
----
-
-# Localization
-
-To localize __RadDataLayout__ to display any text and messages in a specific language:
-
-* All required classes for localization are defined in __Telerik.WinControls.UI.Localization__ namespace.
-
-* Start by creating a descendant of the __LayoutControlLocalizationProvider__ class.
-
-* Override the __GetLocalizedString(string id)__ method and provide a translation for the label and user messages. If a translation is not provided, the default value will be returned. This behavior is guaranteed by the call to the base __GetLocalizedString__ method in the __default__ clause of the __switch__ statement in the example.
-
-Below is a sample implementation of an English localization provider:
-
-{{source=..\SamplesCS\DataLayout\DataLayoutLocalization.cs region=Localization}}
-{{source=..\SamplesVB\DataLayout\DataLayoutLocalization.vb region=Localization}}
-
-````C#
-public class MyEnglishLayoutControlLocalizationProvider : LayoutControlLocalizationProvider
-{
- public override string GetLocalizedString(string id)
- {
- switch (id)
- {
- case LayoutControlStringId.CustomizeDialogHiddenItems:
- return "Hidden Items ({0})";
- case LayoutControlStringId.CustomizeDialogNewItems:
- return "New Items ({0})";
- case LayoutControlStringId.CustomizeDialogPageItems:
- return "Items";
- case LayoutControlStringId.CustomizeDialogPageStructure:
- return "Structure";
- case LayoutControlStringId.CustomizeDialogRootItem:
- return "Root";
- case LayoutControlStringId.CustomizeDialogSaveLayout:
- return "Save Layout";
- case LayoutControlStringId.CustomizeDialogLoadLayout:
- return "Load Layout";
- case LayoutControlStringId.NewGroupDefaultText:
- return "Item Group";
- case LayoutControlStringId.NewLabelDefaultText:
- return "Label Item";
- case LayoutControlStringId.CustomizeDialogNewItemsEmptySpace:
- return "Empty Space";
- case LayoutControlStringId.CustomizeDialogNewItemsLabel:
- return "Label";
- case LayoutControlStringId.CustomizeDialogNewItemsSeparator:
- return "Separator";
- case LayoutControlStringId.CustomizeDialogNewItemsSplitter:
- return "Splitter";
- case LayoutControlStringId.CustomizeDialogNewItemsGroup:
- return "Group";
- case LayoutControlStringId.CustomizeDialogNewItemsTabbedGroup:
- return "Tabbed Group";
- case LayoutControlStringId.ContextMenuCustomize:
- return "Customize";
- case LayoutControlStringId.ContextMenuHideItem:
- return "Hide";
- case LayoutControlStringId.CustomizeDialogTitle:
- return "Customize";
- case LayoutControlStringId.ErrorBoxTitle:
- return "Error!";
- case LayoutControlStringId.ErrorFileNotFoundMessage:
- return "File not found!";
- case LayoutControlStringId.ErrorLoadingLayoutMessage:
- return "Error loading layout!";
- }
- return base.GetLocalizedString(id);
- }
-}
-
-````
-````VB.NET
-Public Class MyEnglishLayoutControlLocalizationProvider
- Inherits LayoutControlLocalizationProvider
- Public Overrides Function GetLocalizedString(id As String) As String
- Select Case id
- Case LayoutControlStringId.CustomizeDialogHiddenItems
- Return "Hidden Items ({0})"
- Case LayoutControlStringId.CustomizeDialogNewItems
- Return "New Items ({0})"
- Case LayoutControlStringId.CustomizeDialogPageItems
- Return "Items"
- Case LayoutControlStringId.CustomizeDialogPageStructure
- Return "Structure"
- Case LayoutControlStringId.CustomizeDialogRootItem
- Return "Root"
- Case LayoutControlStringId.CustomizeDialogSaveLayout
- Return "Save Layout"
- Case LayoutControlStringId.CustomizeDialogLoadLayout
- Return "Load Layout"
- Case LayoutControlStringId.NewGroupDefaultText
- Return "Item Group"
- Case LayoutControlStringId.NewLabelDefaultText
- Return "Label Item"
- Case LayoutControlStringId.CustomizeDialogNewItemsEmptySpace
- Return "Empty Space"
- Case LayoutControlStringId.CustomizeDialogNewItemsLabel
- Return "Label"
- Case LayoutControlStringId.CustomizeDialogNewItemsSeparator
- Return "Separator"
- Case LayoutControlStringId.CustomizeDialogNewItemsSplitter
- Return "Splitter"
- Case LayoutControlStringId.CustomizeDialogNewItemsGroup
- Return "Group"
- Case LayoutControlStringId.CustomizeDialogNewItemsTabbedGroup
- Return "Tabbed Group"
- Case LayoutControlStringId.ContextMenuCustomize
- Return "Customize"
- Case LayoutControlStringId.ContextMenuHideItem
- Return "Hide"
- Case LayoutControlStringId.CustomizeDialogTitle
- Return "Customize"
- Case LayoutControlStringId.ErrorBoxTitle
- Return "Error!"
- Case LayoutControlStringId.ErrorFileNotFoundMessage
- Return "File not found!"
- Case LayoutControlStringId.ErrorLoadingLayoutMessage
- Return "Error loading layout!"
- End Select
- Return MyBase.GetLocalizedString(id)
- End Function
-End Class
-
-````
-
-{{endregion}}
-
-To apply the custom localization provider, instantiate and assign it to the current localization provider:
-
-#### Assigning the Current Localization Provider
-
-{{source=..\SamplesCS\DataLayout\DataLayoutLocalization.cs region=SetProvider}}
-{{source=..\SamplesVB\DataLayout\DataLayoutLocalization.vb region=SetProvider}}
-
-````C#
-LayoutControlLocalizationProvider.CurrentProvider = new MyEnglishLayoutControlLocalizationProvider();
-
-````
-````VB.NET
-LayoutControlLocalizationProvider.CurrentProvider = New MyEnglishLayoutControlLocalizationProvider()
-
-````
-
-{{endregion}}
-
-# See Also
-
- * [Structure]({%slug winforms/datalayout/control-element-structure%})
- * [Getting Started]({%slug winforms/datalayout/getting-started%})
- * [Properties, events and attributes]({%slug winforms/datalayout/properties,-events-and-attributes%})
- * [Validation]({%slug winforms/datalayout/validation%})
- * [Change the editor to RadDropDownList]({%slug winforms/dataentry/how-to/change-the-editor-to-a-bound-raddropdownlist%})
- * [Customizing Appearance ]({%slug winforms/raddatalayout/customizing-appearance%})
+---
+title: Localization
+page_title: Localization - WinForms DataLayout Control
+description: learn how you can localize the string used in WinForms DataLayout.
+slug: winforms/datalayout/localization
+tags: localization
+published: True
+position: 8
+previous_url: datalayout-localization
+---
+
+# Localization
+
+To localize __RadDataLayout__ to display any text and messages in a specific language:
+
+* All required classes for localization are defined in __Telerik.WinControls.UI.Localization__ namespace.
+
+* Start by creating a descendant of the __LayoutControlLocalizationProvider__ class.
+
+* Override the __GetLocalizedString(string id)__ method and provide a translation for the label and user messages. If a translation is not provided, the default value will be returned. This behavior is guaranteed by the call to the base __GetLocalizedString__ method in the __default__ clause of the __switch__ statement in the example.
+
+Below is a sample implementation of an English localization provider:
+
+
+
+
+
+
+To apply the custom localization provider, instantiate and assign it to the current localization provider:
+
+#### Assigning the Current Localization Provider
+
+
+
+
+
+
+# See Also
+
+ * [Structure]({%slug winforms/datalayout/control-element-structure%})
+ * [Getting Started]({%slug winforms/datalayout/getting-started%})
+ * [Properties, events and attributes]({%slug winforms/datalayout/properties,-events-and-attributes%})
+ * [Validation]({%slug winforms/datalayout/validation%})
+ * [Change the editor to RadDropDownList]({%slug winforms/dataentry/how-to/change-the-editor-to-a-bound-raddropdownlist%})
+ * [Customizing Appearance ]({%slug winforms/raddatalayout/customizing-appearance%})
diff --git a/controls/datalayout/properties-events-and-attributes.md b/controls/datalayout/properties-events-and-attributes.md
index 6e9d4dc0c..5a5797d76 100644
--- a/controls/datalayout/properties-events-and-attributes.md
+++ b/controls/datalayout/properties-events-and-attributes.md
@@ -60,78 +60,10 @@ __RadDataLayout__ has support for several attributes that can be used to change
#### Using attributes.
-{{source=..\SamplesCS\DataLayout\PropertiesEventsAttributesForm.cs region=ModelWithAttributes}}
-{{source=..\SamplesVB\DataLayout\PropertiesEventsAttributesForm.vb region=ModelWithAttributes}}
-
-````C#
-public class Employee
-{
- public string FirstName { get; set; }
- [DisplayName("Family Name")]
- public string LastName { get; set; }
- [Browsable(false)]
- public string Occupation { get; set; }
- [RadRange(2000, 3000)]
- public int Salary { get; set; }
- public DateTime StartingDate { get; set; }
-}
-
-````
-````VB.NET
-Public Class Employee
- Public Property FirstName() As String
- Get
- Return m_FirstName
- End Get
- Set(value As String)
- m_FirstName = value
- End Set
- End Property
- Private m_FirstName As String
- _
- Public Property LastName() As String
- Get
- Return m_LastName
- End Get
- Set(value As String)
- m_LastName = value
- End Set
- End Property
- Private m_LastName As String
- _
- Public Property Occupation() As String
- Get
- Return m_Occupation
- End Get
- Set(value As String)
- m_Occupation = value
- End Set
- End Property
- Private m_Occupation As String
- _
- Public Property Salary() As Integer
- Get
- Return m_Salary
- End Get
- Set(value As Integer)
- m_Salary = value
- End Set
- End Property
- Private m_Salary As Integer
- Public Property StartingDate() As DateTime
- Get
- Return m_StartingDate
- End Get
- Set(value As DateTime)
- m_StartingDate = value
- End Set
- End Property
- Private m_StartingDate As DateTime
-End Class
-
-````
-
-{{endregion}}
+
+
+
+
# See Also
diff --git a/controls/datalayout/save-load-layout.md b/controls/datalayout/save-load-layout.md
index 959b858f3..2a37840fc 100644
--- a/controls/datalayout/save-load-layout.md
+++ b/controls/datalayout/save-load-layout.md
@@ -14,73 +14,18 @@ previous_url: datalayout-save-load-layout
__RadDataLayout__ allows changes at runtime. The control can export/import its layout which is stored in Xml format. This funtionality can be utilized by calling the __SaveLayout__ and __LoadLayout__ methods.
#### Save the layout.
-{{source=..\SamplesCS\DataLayout\LoadSaveLayout.cs region=SaveLayout}}
-{{source=..\SamplesVB\DataLayout\LoadSaveLayout.vb region=SaveLayout}}
-````C#
-private void SaveLayout()
-{
- using (SaveFileDialog sfd = new SaveFileDialog())
- {
- sfd.DefaultExt = ".xml";
- sfd.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.*";
- if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- this.radDataLayout1.LayoutControl.SaveLayout(sfd.FileName);
- }
- }
-}
+
+
-````
-````VB.NET
-Private Sub SaveLayout()
- Using sfd As New SaveFileDialog()
- sfd.DefaultExt = ".xml"
- sfd.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.*"
- If sfd.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
- Me.RadDataLayout1.LayoutControl.SaveLayout(sfd.FileName)
- End If
- End Using
-End Sub
-````
-
-{{endregion}}
#### Load the Layout
-{{source=..\SamplesCS\DataLayout\LoadSaveLayout.cs region=LoadLayout}}
-{{source=..\SamplesVB\DataLayout\LoadSaveLayout.vb region=LoadLayout}}
-
-````C#
-private void LoadLayout()
-{
- using (OpenFileDialog ofd = new OpenFileDialog())
- {
- ofd.DefaultExt = ".xml";
- ofd.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.*";
- if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- this.radDataLayout1.LayoutControl.LoadLayout(ofd.FileName);
- }
- }
-}
-
-````
-````VB.NET
-Private Sub LoadLayout()
- Using ofd As New OpenFileDialog()
- ofd.DefaultExt = ".xml"
- ofd.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.*"
- If ofd.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
- Me.RadDataLayout1.LayoutControl.LoadLayout(ofd.FileName)
- End If
- End Using
-End Sub
+
+
-````
-{{endregion}}
The layout can be saved/loaded with the [customize dialog]({%slug winforms/datalayout/customize-layout-mode%}) as well.
diff --git a/controls/datalayout/validation.md b/controls/datalayout/validation.md
index 3c1f63f73..205258c20 100644
--- a/controls/datalayout/validation.md
+++ b/controls/datalayout/validation.md
@@ -15,291 +15,39 @@ For the need of the validation process we made two events (__ItemValidating, Ite
1\. For the purpose of this tutorial, we will create a new class **Employee** with a couple of exposed properties. By binding __RadDataLayout__ to object from this type we will generate several items:
-{{source=..\SamplesCS\DataLayout\DataLayoutValidation.cs region=DataLayoutEmployee}}
-{{source=..\SamplesVB\DataLayout\DataLayoutValidation.vb region=DataLayoutEmployee}}
+
+
-````C#
-public class Employee
-{
- [DisplayName("First Name")]
- public string FirstName { get; set; }
- [DisplayName("Family Name")]
- public string LastName { get; set; }
- public string Occupation { get; set; }
- public int Salary { get; set; }
- public DateTime StartingDate { get; set; }
- public bool IsMarried { get; set; }
-}
-````
-````VB.NET
-Public Class Employee
- _
- Public Property FirstName() As String
- Get
- Return m_FirstName
- End Get
- Set(value As String)
- m_FirstName = value
- End Set
- End Property
- Private m_FirstName As String
- _
- Public Property LastName() As String
- Get
- Return m_LastName
- End Get
- Set(value As String)
- m_LastName = value
- End Set
- End Property
- Private m_LastName As String
- Public Property Occupation() As String
- Get
- Return m_Occupation
- End Get
- Set(value As String)
- m_Occupation = value
- End Set
- End Property
- Private m_Occupation As String
- Public Property Salary() As Integer
- Get
- Return m_Salary
- End Get
- Set(value As Integer)
- m_Salary = value
- End Set
- End Property
- Private m_Salary As Integer
- Public Property StartingDate() As DateTime
- Get
- Return m_StartingDate
- End Get
- Set(value As DateTime)
- m_StartingDate = value
- End Set
- End Property
- Private m_StartingDate As DateTime
- Public Property IsMarried() As Boolean
- Get
- Return m_IsMarried
- End Get
- Set(value As Boolean)
- m_IsMarried = value
- End Set
- End Property
- Private m_IsMarried As Boolean
-End Class
-````
+
+
-{{endregion}}
-{{source=..\SamplesCS\DataLayout\DataLayoutValidation.cs region=DataLayoutBinding}}
-{{source=..\SamplesVB\DataLayout\DataLayoutValidation.vb region=DataLayoutBinding}}
-
-````C#
-this.radDataLayout1.DataSource = new Employee()
-{
- FirstName = "Sarah",
- LastName = "Blake",
- Occupation = "Supplied Manager",
- StartingDate = new DateTime(2005, 04, 12),
- Salary = 1500,
- IsMarried = true
-};
-
-````
-````VB.NET
-Me.RadDataLayout1.DataSource = New Employee() With {
- .FirstName = "Sarah",
- .LastName = "Blake",
- .Occupation = "Supplied Manager",
- .StartingDate = New DateTime(2005, 4, 12),
- .Salary = 1500,
- .IsMarried = True
-}
-
-````
-
-{{endregion}}
>caption Figure 1: RadDataLayout Initialized

2\. Set the __ShowValidationPanel__ property to *true*. This will display the panel below the editors:
-{{source=..\SamplesCS\DataLayout\DataLayoutValidation.cs region=DataLayoutShowPanel}}
-{{source=..\SamplesVB\DataLayout\DataLayoutValidation.vb region=DataLayoutShowPanel}}
-
-````C#
-this.radDataLayout1.ShowValidationPanel = true;
+
+
-````
-````VB.NET
-Me.RadDataLayout1.ShowValidationPanel = True
-````
-
-{{endregion}}
3\. Set a padding to the __LayoutControlContainerElement__ so that the error icons are visible. A suitable place to perform this operation is the handler of the __BindingCreated__.
-{{source=..\SamplesCS\DataLayout\DataLayoutValidation.cs region=DataLayoutSetPadding}}
-{{source=..\SamplesVB\DataLayout\DataLayoutValidation.vb region=DataLayoutSetPadding}}
-
-````C#
-private void radDataLayout1_BindingCreated(object sender, Telerik.WinControls.UI.BindingCreatedEventArgs e)
-{
- this.radDataLayout1.LayoutControl.ContainerElement.Padding = new Padding(0, 0, 20, 0);
-}
-
-````
-````VB.NET
-Private Sub RadDataLayout1_BindingCreated(sender As Object, e As BindingCreatedEventArgs)
- Me.RadDataLayout1.LayoutControl.ContainerElement.Padding = New Padding(0, 0, 20, 0)
-End Sub
+
+
-````
-{{endregion}}
4\. Subscribe to the __ItemValidated__ event of __RadDataEntry__:
-{{source=..\SamplesCS\DataLayout\DataLayoutValidation.cs region=DataLayoutItemValidated}}
-{{source=..\SamplesVB\DataLayout\DataLayoutValidation.vb region=DataLayoutItemValidated}}
-
-````C#
-private void radDataLayout1_ItemValidated(object sender, Telerik.WinControls.UI.DataLayoutItemValidatedEventArgs e)
-{
- Employee employee = this.radDataLayout1.CurrentObject as Employee;
- if (e.Item.Text == "First Name")
- {
- if (employee.FirstName.Length < 2 || employee.FirstName.Length > 15)
- {
- e.ErrorProvider.SetError((sender as Control), "First Name should be between 2 and 15 chars long.");
- if (!this.radDataLayout1.ValidationPanel.PanelContainer.Controls.ContainsKey("FirstName"))
- {
- RadLabel label = new RadLabel();
- label.Name = "FirstName";
- label.Text = "FirstName : First Name should be between 2 and 15 chars long.";
- label.Dock = DockStyle.Top;
- label.AutoSize = false;
- label.BackColor = Color.Transparent;
- this.radDataLayout1.ValidationPanel.PanelContainer.Controls.Add(label);
- }
- }
- else
- {
- e.ErrorProvider.Clear();
- this.radDataLayout1.ValidationPanel.PanelContainer.Controls.RemoveByKey("FirstName");
- }
- }
- else if (e.Item.Text == "Family Name")
- {
- if (employee.LastName.Length < 2 || employee.LastName.Length > 15)
- {
- e.ErrorProvider.SetError((sender as Control), "Last Name should be between 2 and 15 chars long.");
- if (!this.radDataLayout1.ValidationPanel.PanelContainer.Controls.ContainsKey("LastName"))
- {
- RadLabel label = new RadLabel();
- label.Name = "LastName";
- label.Text = "LastName : Last Name should be between 2 and 15 chars long.";
- label.Dock = DockStyle.Top;
- label.AutoSize = false;
- label.BackColor = Color.Transparent;
- this.radDataLayout1.ValidationPanel.PanelContainer.Controls.Add(label);
- }
- }
- else
- {
- e.ErrorProvider.Clear();
- this.radDataLayout1.ValidationPanel.PanelContainer.Controls.RemoveByKey("LastName");
- }
- }
- else if (e.Item.Text == "Salary")
- {
- if (employee.Salary < 1400 || employee.Salary > 1800)
- {
- e.ErrorProvider.SetError((sender as Control), "Salary should be in range 1500 - 1700.");
- if (!this.radDataLayout1.ValidationPanel.PanelContainer.Controls.ContainsKey("Salary"))
- {
- RadLabel label = new RadLabel();
- label.Name = "Salary";
- label.Text = "Salary : Salary should be in range 1500 - 1700.";
- label.Dock = DockStyle.Top;
- label.AutoSize = false;
- label.BackColor = Color.Transparent;
- this.radDataLayout1.ValidationPanel.PanelContainer.Controls.Add(label);
- }
- }
- else
- {
- e.ErrorProvider.Clear();
- this.radDataLayout1.ValidationPanel.PanelContainer.Controls.RemoveByKey("Salary");
- }
- }
-}
-
-````
-````VB.NET
-Private Sub radDataLayout1_ItemValidated(sender As Object, e As Telerik.WinControls.UI.DataLayoutItemValidatedEventArgs)
- Dim employee As Employee = TryCast(Me.RadDataLayout1.CurrentObject, Employee)
- If e.Item.Text = "First Name" Then
- If employee.FirstName.Length < 2 OrElse employee.FirstName.Length > 15 Then
- e.ErrorProvider.SetError(TryCast(sender, Control), "First Name should be between 2 and 15 chars long.")
- If Not Me.RadDataLayout1.ValidationPanel.PanelContainer.Controls.ContainsKey("FirstName") Then
- Dim label As New RadLabel()
- label.Name = "FirstName"
- label.Text = "FirstName : First Name should be between 2 and 15 chars long."
- label.Dock = DockStyle.Top
- label.AutoSize = False
- label.BackColor = Color.Transparent
- Me.RadDataLayout1.ValidationPanel.PanelContainer.Controls.Add(label)
- End If
- Else
- e.ErrorProvider.Clear()
- Me.RadDataLayout1.ValidationPanel.PanelContainer.Controls.RemoveByKey("FirstName")
- End If
- ElseIf e.Item.Text = "Family Name" Then
- If employee.LastName.Length < 2 OrElse employee.LastName.Length > 15 Then
- e.ErrorProvider.SetError(TryCast(sender, Control), "Last Name should be between 2 and 15 chars long.")
- If Not Me.RadDataLayout1.ValidationPanel.PanelContainer.Controls.ContainsKey("LastName") Then
- Dim label As New RadLabel()
- label.Name = "LastName"
- label.Text = "LastName : Last Name should be between 2 and 15 chars long."
- label.Dock = DockStyle.Top
- label.AutoSize = False
- label.BackColor = Color.Transparent
- Me.RadDataLayout1.ValidationPanel.PanelContainer.Controls.Add(label)
- End If
- Else
- e.ErrorProvider.Clear()
- Me.RadDataLayout1.ValidationPanel.PanelContainer.Controls.RemoveByKey("LastName")
- End If
- ElseIf e.Item.Text = "Salary" Then
- If employee.Salary < 1400 OrElse employee.Salary > 1800 Then
- e.ErrorProvider.SetError(TryCast(sender, Control), "Salary should be in range 1500 - 1700.")
- If Not Me.RadDataLayout1.ValidationPanel.PanelContainer.Controls.ContainsKey("Salary") Then
- Dim label As New RadLabel()
- label.Name = "Salary"
- label.Text = "Salary : Salary should be in range 1500 - 1700."
- label.Dock = DockStyle.Top
- label.AutoSize = False
- label.BackColor = Color.Transparent
- Me.RadDataLayout1.ValidationPanel.PanelContainer.Controls.Add(label)
- End If
- Else
- e.ErrorProvider.Clear()
- Me.RadDataLayout1.ValidationPanel.PanelContainer.Controls.RemoveByKey("Salary")
- End If
- End If
-End Sub
+
+
-````
-{{endregion}}
>caption Figure 2: Validaton Errors

diff --git a/controls/desktopalert/button-items.md b/controls/desktopalert/button-items.md
index 23eb36009..9cfcf15f9 100644
--- a/controls/desktopalert/button-items.md
+++ b/controls/desktopalert/button-items.md
@@ -18,50 +18,7 @@ __RadDesktopAlert__ supports adding custom items to the pop up by using the __Bu
#### Adding elements to the ButtonItems collection
-{{source=..\SamplesCS\DesktopAlert\DesktopAlert1.cs region=ButtonItems}}
-{{source=..\SamplesVB\DesktopAlert\DesktopAlert1.vb region=ButtonItems}}
+
+
-````C#
-
-public void AddButtonItems()
-{
- RadLabelElement labelElement = new RadLabelElement();
- labelElement.Text = "Recipients count: ";
- labelElement.Padding = new System.Windows.Forms.Padding(0, 5, 0, 0);
- RadButtonElement buttonElement = new RadButtonElement();
- buttonElement.Text = "Send";
- buttonElement.Click += ButtonElement_Click;
- RadSpinEditorElement spinElement = new RadSpinEditorElement();
- spinElement.MinSize = new Size(50, 20);
- this.radDesktopAlert1.ButtonItems.Add(labelElement);
- this.radDesktopAlert1.ButtonItems.Add(spinElement);
- this.radDesktopAlert1.ButtonItems.Add(buttonElement);
-}
-
-private void ButtonElement_Click(object sender, EventArgs e)
-{
- //TODO
-}
-
-````
-````VB.NET
-Public Sub AddButtonItems()
- Dim labelElement As New RadLabelElement()
- labelElement.Text = "Recipients count: "
- labelElement.Padding = New System.Windows.Forms.Padding(0, 5, 0, 0)
- Dim buttonElement As New RadButtonElement()
- buttonElement.Text = "Send"
- AddHandler buttonElement.Click, AddressOf ButtonElement_Click
- Dim spinElement As New RadSpinEditorElement()
- spinElement.MinSize = New Size(50, 20)
- Me.radDesktopAlert1.ButtonItems.Add(labelElement)
- Me.radDesktopAlert1.ButtonItems.Add(spinElement)
- Me.radDesktopAlert1.ButtonItems.Add(buttonElement)
-End Sub
-Private Sub ButtonElement_Click(sender As Object, e As EventArgs)
-'TODO
-End Sub
-
-````
-
-{{endregion}}
+
diff --git a/controls/desktopalert/customizing-appearance/accessing-and-customizing-elements.md b/controls/desktopalert/customizing-appearance/accessing-and-customizing-elements.md
index 1ff4d8035..5c96bcd11 100644
--- a/controls/desktopalert/customizing-appearance/accessing-and-customizing-elements.md
+++ b/controls/desktopalert/customizing-appearance/accessing-and-customizing-elements.md
@@ -20,40 +20,7 @@ The following code example demonstrates how to customize the nested elements at
#### Customize elements
-{{source=..\SamplesCS\DesktopAlert\DesktopAlert1.cs region=AccessingCustomizingElements}}
-{{source=..\SamplesVB\DesktopAlert\DesktopAlert1.vb region=AccessingCustomizingElements}}
+
+
-````C#
-
-this.radDesktopAlert1.Popup.AlertElement.CaptionElement.TextAndButtonsElement.TextElement.ForeColor = Color.Red;
-this.radDesktopAlert1.Popup.AlertElement.CaptionElement.CaptionGrip.BackColor = Color.Red;
-this.radDesktopAlert1.Popup.AlertElement.CaptionElement.CaptionGrip.GradientStyle = GradientStyles.Solid;
-this.radDesktopAlert1.Popup.AlertElement.ContentElement.Font = new Font("Arial", 8f,FontStyle.Italic);
-this.radDesktopAlert1.Popup.AlertElement.ContentElement.TextImageRelation = TextImageRelation.TextBeforeImage;
-this.radDesktopAlert1.Popup.AlertElement.BackColor = Color.Yellow;
-this.radDesktopAlert1.Popup.AlertElement.GradientStyle = GradientStyles.Solid;
-this.radDesktopAlert1.Popup.AlertElement.BorderColor = Color.Red;
-
-````
-````VB.NET
-Me.radDesktopAlert1.Popup.AlertElement.CaptionElement.TextAndButtonsElement.TextElement.ForeColor = Color.Red
-Me.radDesktopAlert1.Popup.AlertElement.CaptionElement.CaptionGrip.BackColor = Color.Red
-Me.radDesktopAlert1.Popup.AlertElement.CaptionElement.CaptionGrip.GradientStyle = GradientStyles.Solid
-Me.radDesktopAlert1.Popup.AlertElement.ContentElement.Font = New Font("Arial", 8.0F, FontStyle.Italic)
-Me.radDesktopAlert1.Popup.AlertElement.ContentElement.TextImageRelation = TextImageRelation.TextBeforeImage
-Me.radDesktopAlert1.Popup.AlertElement.BackColor = Color.Yellow
-Me.radDesktopAlert1.Popup.AlertElement.GradientStyle = GradientStyles.Solid
-Me.radDesktopAlert1.Popup.AlertElement.BorderColor = Color.Red
-'#End Region
-End Sub
-'#region showingAlert
-Private Sub radButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
-Me.radDesktopAlert1.ContentImage = envelopeImage
-Me.radDesktopAlert1.CaptionText = "New E-mail Notification"
-Me.radDesktopAlert1.ContentText = "Hello Jack, I am writing to inform you " & "that the planning meeting scheduled for Wednesday has been postponed and" & "it will eventually be rescheduled, possibly for the next Tuesday"
-Me.radDesktopAlert1.Show()
-End Sub
-
-````
-
-{{endregion}}
+
diff --git a/controls/desktopalert/gettingstarted.md b/controls/desktopalert/gettingstarted.md
index a397cee23..672fafed2 100644
--- a/controls/desktopalert/gettingstarted.md
+++ b/controls/desktopalert/gettingstarted.md
@@ -48,33 +48,10 @@ Follow the described steps below:
#### Setting up RadDesktopAlert
-{{source=..\SamplesCS\DesktopAlert\DesktopAlert1.cs region=showingAlert}}
-{{source=..\SamplesVB\DesktopAlert\DesktopAlert1.vb region=showingAlert}}
-
-````C#
-
-void radButton1_Click(object sender, EventArgs e)
-{
- this.radDesktopAlert1.ContentImage = envelopeImage;
- this.radDesktopAlert1.CaptionText = "New E-mail Notification";
- this.radDesktopAlert1.ContentText = "Hello Jack, I am writing to inform you " +
- "that the planning meeting scheduled for Wednesday has been postponed and" +
- "it will eventually be rescheduled, possibly for the next Tuesday";
- this.radDesktopAlert1.Show();
-}
-
-````
-````VB.NET
-Private Sub radButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
- Me.radDesktopAlert1.ContentImage = envelopeImage
- Me.radDesktopAlert1.CaptionText = "New E-mail Notification"
- Me.radDesktopAlert1.ContentText = "Hello Jack, I am writing to inform you " & "that the planning meeting scheduled for Wednesday has been postponed and" & "it will eventually be rescheduled, possibly for the next Tuesday"
- Me.radDesktopAlert1.Show()
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
This way you will display an alert window at the bottom right part of the screen just the same way Microsoft Outlook does.
diff --git a/controls/diagram/background-grid.md b/controls/diagram/background-grid.md
index 813fee514..8661586f8 100644
--- a/controls/diagram/background-grid.md
+++ b/controls/diagram/background-grid.md
@@ -18,21 +18,10 @@ You can control the background settings of the diagramming surface through the f
#### Set IsBackgroundSurfaceVisible
-{{source=..\SamplesCS\Diagram\DiagramBackgroundGrid.cs region=IsBackgroundSurfaceVisible}}
-{{source=..\SamplesVB\Diagram\DiagramBackgroundGrid.vb region=IsBackgroundSurfaceVisible}}
+
+
-````C#
-
-this.radDiagram1.DiagramElement.IsBackgroundSurfaceVisible = true;
-
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.IsBackgroundSurfaceVisible = True
-````
-
-{{endregion}}
-
| __IsBackgroundSurfaceVisible__ = *true* | __IsBackgroundSurfaceVisible__ = *false* |
|----|----|
@@ -42,21 +31,11 @@ Me.RadDiagram1.DiagramElement.IsBackgroundSurfaceVisible = True
#### Set Background
-{{source=..\SamplesCS\Diagram\DiagramBackgroundGrid.cs region=Background}}
-{{source=..\SamplesVB\Diagram\DiagramBackgroundGrid.vb region=Background}}
+
+
-````C#
-
-this.radDiagram1.DiagramElement.BackgroundGrid.Background = new System.Drawing.SolidBrush(Color.LightYellow);
-
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.BackgroundGrid.Background = New System.Drawing.SolidBrush(Color.LightYellow)
-````
-{{endregion}}
-
>caption Figure 1: Background

@@ -71,20 +50,10 @@ You can access the __BackgroundGrid__ properties:
#### Set CellSize
-{{source=..\SamplesCS\Diagram\DiagramBackgroundGrid.cs region=CellSize}}
-{{source=..\SamplesVB\Diagram\DiagramBackgroundGrid.vb region=CellSize}}
+
+
-````C#
-
-this.radDiagram1.DiagramElement.BackgroundGrid.CellSize = new Telerik.Windows.Diagrams.Core.Size(40, 40);
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.BackgroundGrid.CellSize = New Telerik.Windows.Diagrams.Core.Size(40, 40)
-
-````
-
-{{endregion}}
* __LineStroke__: this property is of type *Brush* and it specifies how the cells outline is painted.
@@ -95,20 +64,11 @@ Me.RadDiagram1.DiagramElement.BackgroundGrid.CellSize = New Telerik.Windows.Diag
#### Set LineStroke
-{{source=..\SamplesCS\Diagram\DiagramBackgroundGrid.cs region=LineStroke}}
-{{source=..\SamplesVB\Diagram\DiagramBackgroundGrid.vb region=LineStroke}}
-
-````C#
-
-this.radDiagram1.DiagramElement.BackgroundGrid.LineStroke = new System.Drawing.SolidBrush(Color.Red);
+
+
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.BackgroundGrid.LineStroke = New System.Drawing.SolidBrush(Color.Red)
-````
-{{endregion}}
* __LineStrokeThickness__: this property is of type *double* and it gets or sets the thickness of the __RadDiagram__ background grid lines.
@@ -118,20 +78,10 @@ Me.RadDiagram1.DiagramElement.BackgroundGrid.LineStroke = New System.Drawing.Sol
#### Set LineStrokeThickness
-{{source=..\SamplesCS\Diagram\DiagramBackgroundGrid.cs region=LineStrokeThickness}}
-{{source=..\SamplesVB\Diagram\DiagramBackgroundGrid.vb region=LineStrokeThickness}}
-
-````C#
-
-this.radDiagram1.DiagramElement.BackgroundGrid.LineStrokeThickness = 5;
-
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.BackgroundGrid.LineStrokeThickness = 5
+
+
-````
-{{endregion}}
# See Also
diff --git a/controls/diagram/custom-shapes.md b/controls/diagram/custom-shapes.md
index 3f1301bb6..946fe1068 100644
--- a/controls/diagram/custom-shapes.md
+++ b/controls/diagram/custom-shapes.md
@@ -17,75 +17,14 @@ This tutorial will guide you through the task of creating a custom shape.
In order to create a custom shape, you need to define a custom shape class deriving from the __ElementShape__ class. Overriding its __CreatePath__ method you can define the desired shape. Afterwards, you need to apply your shape implementation to the RadDiagramShape.__ElementShape__ property:
-{{source=..\SamplesCS\Diagram\DiagramCustomShapes.cs region=MyShape}}
-{{source=..\SamplesVB\Diagram\DiagramCustomShapes.vb region=MyShape}}
-
-````C#
-
-public class MyShape : ElementShape
-{
- public override GraphicsPath CreatePath(System.Drawing.Rectangle bounds)
- {
- GraphicsPath path = new GraphicsPath();
- path.AddString("Custom", new System.Drawing.FontFamily("Arial"), 0, bounds.Width, Point.Empty, StringFormat.GenericTypographic);
- return path;
- }
-}
-
-````
-````VB.NET
-Public Class MyShape
-Inherits ElementShape
- Public Overrides Function CreatePath(bounds As System.Drawing.Rectangle) As GraphicsPath
- Dim path As New GraphicsPath()
- path.AddString("Custom", New System.Drawing.FontFamily("Arial"), 0, bounds.Width, Point.Empty, StringFormat.GenericTypographic)
- Return path
- End Function
-End Class
-
-````
-
-{{endregion}}
-
-
-{{source=..\SamplesCS\Diagram\DiagramCustomShapes.cs region=ApplyCustomShape}}
-{{source=..\SamplesVB\Diagram\DiagramCustomShapes.vb region=ApplyCustomShape}}
-
-````C#
-
-RadDiagramShape shape1 = new RadDiagramShape()
-{
- Text = "",
- ElementShape = new MyShape(),
- BackColor = System.Drawing.Color.LightBlue
-};
-shape1.Position = new Telerik.Windows.Diagrams.Core.Point(100, 80);
-radDiagram1.AddShape(shape1);
-
-````
-````VB.NET
-Dim shape1 As New RadDiagramShape() With { _
- .Text = "", _
- .ElementShape = New MyShape(), _
- .BackColor = System.Drawing.Color.LightBlue _
-}
-shape1.Position = New Telerik.Windows.Diagrams.Core.Point(100, 80)
-'#Region ""
-RadDiagram1.AddShape(shape1)
-End Sub
-'#Region "MyShape"
-Public Class MyShape
-Inherits ElementShape
-Public Overrides Function CreatePath(bounds As System.Drawing.Rectangle) As GraphicsPath
- Dim path As New GraphicsPath()
- path.AddString("Custom", New System.Drawing.FontFamily("Arial"), 0, bounds.Width, Point.Empty, StringFormat.GenericTypographic)
- Return path
-End Function
-End Class
-
-````
-
-{{endregion}}
+
+
+
+
+
+
+
+

diff --git a/controls/diagram/data-binding/binding-to-custom-objects.md b/controls/diagram/data-binding/binding-to-custom-objects.md
index f56a26279..91449832d 100644
--- a/controls/diagram/data-binding/binding-to-custom-objects.md
+++ b/controls/diagram/data-binding/binding-to-custom-objects.md
@@ -20,636 +20,16 @@ The data source should contain columns/fields that represent the shapes/connecti
Consider the following classes:
-{{source=..\SamplesCS\Diagram\DiagramDataBinding.cs region=CustomObjects}}
-{{source=..\SamplesVB\Diagram\DiagramDataBinding.vb region=CustomObjects}}
+
+
-````C#
-
-public class Task : INotifyPropertyChanged
-{
- private string id;
- private string text;
- private string type;
- private double x;
- private double y;
- private double width;
- private double height;
-
- public string Id
- {
- get
- {
- return this.id;
- }
- set
- {
- this.id = value;
- if (this.id != value)
- {
- this.id = value;
- OnPropertyChanged("Id");
- }
- }
- }
-
- public string Text
- {
- get
- {
- return this.text;
- }
- set
- {
- this.text = value;
- if (this.text != value)
- {
- this.text = value;
- OnPropertyChanged("Text");
- }
- }
- }
-
- public string Type
- {
- get
- {
- return this.type;
- }
- set
- {
- if (this.type != value)
- {
- this.type = value;
- OnPropertyChanged("Type");
- }
- }
- }
-
- public double X
- {
- get
- {
- return this.x;
- }
- set
- {
- if (this.x != value)
- {
- this.x = value;
- OnPropertyChanged("X");
- }
- }
- }
-
- public double Y
- {
- get
- {
- return this.y;
- }
- set
- {
- this.y = value;
- if (this.y != value)
- {
- this.y = value;
- OnPropertyChanged("Y");
- }
- }
- }
-
- public double Height
- {
- get
- {
- return this.height;
- }
- set
- {
- if (this.height != value)
- {
- this.height = value;
- OnPropertyChanged("Height");
- }
- }
- }
-
- public double Width
- {
- get
- {
- return this.width;
- }
- set
- {
- if (this.width != value)
- {
- this.width = value;
- OnPropertyChanged("Width");
- }
- }
- }
-
- private void OnPropertyChanged(string propertyName)
- {
- if (PropertyChanged != null)
- PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
-
- public event PropertyChangedEventHandler PropertyChanged;
-}
-
-public class Relation : INotifyPropertyChanged
-{
- private string sourceTaskId;
- private string sourceConnector;
- private string targetTaskId;
- private string targetConnector;
- private string startCapField;
- private string endCapField;
- public string EndCapField
- {
- get
- {
- return this.endCapField;
- }
- set
- {
- this.endCapField = value;
- if (this.endCapField != value)
- {
- this.endCapField = value;
- OnPropertyChanged("EndCapField");
- }
- }
- }
- public string StartCapField
- {
- get
- {
- return this.startCapField;
- }
- set
- {
- this.startCapField = value;
- if (this.startCapField != value)
- {
- this.startCapField = value;
- OnPropertyChanged("StartCapField");
- }
- }
- }
- public string TargetConnector
- {
- get
- {
- return this.targetConnector;
- }
- set
- {
- this.targetConnector = value;
- if (this.targetConnector != value)
- {
- this.targetConnector = value;
- OnPropertyChanged("TargetConnector");
- }
- }
- }
- public string TargetTaskId
- {
- get
- {
- return this.targetTaskId;
- }
- set
- {
- this.targetTaskId = value;
- if (this.targetTaskId != value)
- {
- this.targetTaskId = value;
- OnPropertyChanged("TargetTaskId");
- }
- }
- }
- public string SourceConnector
- {
- get
- {
- return this.sourceConnector;
- }
- set
- {
- this.sourceConnector = value;
- if (this.sourceConnector != value)
- {
- this.sourceConnector = value;
- OnPropertyChanged("SourceConnector");
- }
- }
- }
- public string SourceTaskId
- {
- get
- {
- return this.sourceTaskId;
- }
- set
- {
- this.sourceTaskId = value;
- if (this.sourceTaskId != value)
- {
- this.sourceTaskId = value;
- OnPropertyChanged("SourceTaskId");
- }
- }
- }
- private void OnPropertyChanged(string propertyName)
- {
- if (PropertyChanged != null)
- PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- public event PropertyChangedEventHandler PropertyChanged;
-}
-
-public class Source
-{
- public BindingList Tasks
- {
- get
- {
- return GetTasks();
- }
- }
-
- public BindingList Relations
- {
- get
- {
- return GetRelations();
- }
- }
-
- private BindingList GetTasks()
- {
- return new BindingList()
- {
- new Task() { Id = "Task1", Text = "Task 1", Type = "circle", X = 100, Y = 300, Width = 50, Height = 50 },
- new Task() { Id = "Task2", Text = "Task 2", Type = "rectangle", X = 200, Y = 100, Width = 100, Height = 100 },
- new Task() { Id = "Task3", Text = "Task 3", Type = "circle", X = 300, Y = 300, Width = 50, Height = 50 },
- new Task() { Id = "Task4", Text = "Task 4", Type = "rectangle", X = 400, Y = 100, Width = 100, Height = 100 },
- new Task() { Id = "Task5", Text = "Task 5", Type = "circle", X = 500, Y = 300, Width = 50, Height = 50 }
- };
- }
-
- private BindingList GetRelations()
- {
- return new BindingList()
- {
- new Relation()
- {
- SourceTaskId = "Task2", SourceConnector = "Left", TargetTaskId = "Task1",
- TargetConnector = "Auto", StartCapField = "Arrow5Filled", EndCapField = "Arrow1"
- },
- new Relation()
- {
- SourceTaskId = "Task2", SourceConnector = "Auto", TargetTaskId = "Task3",
- TargetConnector = "Auto", StartCapField = "Arrow4Filled", EndCapField = "Arrow1Filled"
- },
- new Relation()
- {
- SourceTaskId = "Task4", SourceConnector = "Auto", TargetTaskId = "Task5",
- TargetConnector = "Auto", StartCapField = "Arrow2Filled", EndCapField = "Arrow2"
- }
- };
- }
-}
-
-````
-````VB.NET
-Public Class Task
-Implements INotifyPropertyChanged
- Private m_id As String
- Private m_text As String
- Private m_type As String
- Private m_x As Double
- Private m_y As Double
- Private m_width As Double
- Private m_height As Double
- Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
- Public Property Id() As String
- Get
- Return Me.m_id
- End Get
- Set(value As String)
- Me.m_id = value
- If Me.m_id <> value Then
- Me.m_id = value
- OnPropertyChanged("Id")
- End If
- End Set
- End Property
- Public Property Text() As String
- Get
- Return Me.m_text
- End Get
- Set(value As String)
- Me.m_text = value
- If Me.m_text <> value Then
- Me.m_text = value
- OnPropertyChanged("Text")
- End If
- End Set
- End Property
- Public Property Type() As String
- Get
- Return Me.m_type
- End Get
- Set(value As String)
- If Me.m_type <> value Then
- Me.m_type = value
- OnPropertyChanged("Type")
- End If
- End Set
- End Property
- Public Property X() As Double
- Get
- Return Me.m_x
- End Get
- Set(value As Double)
- If Me.m_x <> value Then
- Me.m_x = value
- OnPropertyChanged("X")
- End If
- End Set
- End Property
- Public Property Y() As Double
- Get
- Return Me.m_y
- End Get
- Set(value As Double)
- Me.m_y = value
- If Me.m_y <> value Then
- Me.m_y = value
- OnPropertyChanged("Y")
- End If
- End Set
- End Property
- Public Property Height() As Double
- Get
- Return Me.m_height
- End Get
- Set(value As Double)
- If Me.m_height <> value Then
- Me.m_height = value
- OnPropertyChanged("Height")
- End If
- End Set
- End Property
- Public Property Width() As Double
- Get
- Return Me.m_width
- End Get
- Set(value As Double)
- If Me.m_width <> value Then
- Me.m_width = value
- OnPropertyChanged("Width")
- End If
- End Set
- End Property
- Private Sub OnPropertyChanged(propertyName As String)
- RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
- End Sub
-End Class
-Public Class Relation
-Implements INotifyPropertyChanged
- Private m_sourceTaskId As String
- Private m_sourceConnector As String
- Private m_targetTaskId As String
- Private m_targetConnector As String
- Private m_startCapField As String
- Private m_endCapField As String
- Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
- Public Property EndCapField() As String
- Get
- Return Me.m_endCapField
- End Get
- Set(value As String)
- Me.m_endCapField = value
- If Me.m_endCapField <> value Then
- Me.m_endCapField = value
- OnPropertyChanged("EndCapField")
- End If
- End Set
- End Property
- Public Property StartCapField() As String
- Get
- Return Me.m_startCapField
- End Get
- Set(value As String)
- Me.m_startCapField = value
- If Me.m_startCapField <> value Then
- Me.m_startCapField = value
- OnPropertyChanged("StartCapField")
- End If
- End Set
- End Property
- Public Property TargetConnector() As String
- Get
- Return Me.m_targetConnector
- End Get
- Set(value As String)
- Me.m_targetConnector = value
- If Me.m_targetConnector <> value Then
- Me.m_targetConnector = value
- OnPropertyChanged("TargetConnector")
- End If
- End Set
- End Property
- Public Property TargetTaskId() As String
- Get
- Return Me.m_targetTaskId
- End Get
- Set(value As String)
- Me.m_targetTaskId = value
- If Me.m_targetTaskId <> value Then
- Me.m_targetTaskId = value
- OnPropertyChanged("TargetTaskId")
- End If
- End Set
- End Property
- Public Property SourceConnector() As String
- Get
- Return Me.m_sourceConnector
- End Get
- Set(value As String)
- Me.m_sourceConnector = value
- If Me.m_sourceConnector <> value Then
- Me.m_sourceConnector = value
- OnPropertyChanged("SourceConnector")
- End If
- End Set
- End Property
- Public Property SourceTaskId() As String
- Get
- Return Me.m_sourceTaskId
- End Get
- Set(value As String)
- Me.m_sourceTaskId = value
- If Me.m_sourceTaskId <> value Then
- Me.m_sourceTaskId = value
- OnPropertyChanged("SourceTaskId")
- End If
- End Set
- End Property
- Private Sub OnPropertyChanged(propertyName As String)
- RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
- End Sub
-
-End Class
-
-Public Class Source
- Public ReadOnly Property Tasks() As BindingList(Of Task)
- Get
- Return GetTasks()
- End Get
- End Property
- Public ReadOnly Property Relations() As BindingList(Of Relation)
- Get
- Return GetRelations()
- End Get
- End Property
- Private Function GetTasks() As BindingList(Of Task)
- Return New BindingList(Of Task)() From { _
- New Task() With { _
- .Id = "Task1", _
- .Text = "Task 1", _
- .Type = "circle", _
- .X = 100, _
- .Y = 300, _
- .Width = 50, _
- .Height = 50 _
- }, _
- New Task() With { _
- .Id = "Task2", _
- .Text = "Task 2", _
- .Type = "rectangle", _
- .X = 200, _
- .Y = 100, _
- .Width = 100, _
- .Height = 100 _
- }, _
- New Task() With { _
- .Id = "Task3", _
- .Text = "Task 3", _
- .Type = "circle", _
- .X = 300, _
- .Y = 300, _
- .Width = 50, _
- .Height = 50 _
- }, _
- New Task() With { _
- .Id = "Task4", _
- .Text = "Task 4", _
- .Type = "rectangle", _
- .X = 400, _
- .Y = 100, _
- .Width = 100, _
- .Height = 100 _
- }, _
- New Task() With { _
- .Id = "Task5", _
- .Text = "Task 5", _
- .Type = "circle", _
- .X = 500, _
- .Y = 300, _
- .Width = 50, _
- .Height = 50 _
- } _
- }
- End Function
- Private Function GetRelations() As BindingList(Of Relation)
- Return New BindingList(Of Relation)() From { _
- New Relation() With { _
- .SourceTaskId = "Task2", _
- .SourceConnector = "Left", _
- .TargetTaskId = "Task1", _
- .TargetConnector = "Auto", _
- .StartCapField = "Arrow5Filled", _
- .EndCapField = "Arrow1" _
- }, _
- New Relation() With { _
- .SourceTaskId = "Task2", _
- .SourceConnector = "Auto", _
- .TargetTaskId = "Task3", _
- .TargetConnector = "Auto", _
- .StartCapField = "Arrow4Filled", _
- .EndCapField = "Arrow1Filled" _
- }, _
- New Relation() With { _
- .SourceTaskId = "Task4", _
- .SourceConnector = "Auto", _
- .TargetTaskId = "Task5", _
- .TargetConnector = "Auto", _
- .StartCapField = "Arrow2Filled", _
- .EndCapField = "Arrow2" _
- } _
- }
- End Function
-End Class
-````
-{{endregion}}
-
The __Task__ class will represent a single shape in __RadDiagram__, while the __Relation__ class will represent a connection. Note that the __Source__ class contains two properties, __Tasks__ and __Relations__ which will be specified as __ConnectionDataMember__ and __ShapeDataMember__ for __RadDiagram__. To make data binding work, you should specify the member properties as well:
-{{source=..\SamplesCS\Diagram\DiagramDataBinding.cs region=SetupMembers}}
-{{source=..\SamplesVB\Diagram\DiagramDataBinding.vb region=SetupMembers}}
-
-````C#
-
-this.radDiagram1.DataSource = new Source();
-
-this.radDiagram1.ConnectionDataMember = "Relations";
-this.radDiagram1.ShapeDataMember = "Tasks";
-this.radDiagram1.ShapeIdMember = "Id";
-this.radDiagram1.ShapeTextMember = "Text";
-this.radDiagram1.ShapeTypeMember = "Type";
-this.radDiagram1.ShapeXMember = "X";
-this.radDiagram1.ShapeYMember = "Y";
-this.radDiagram1.ShapeWidthMember = "Width";
-this.radDiagram1.ShapeHeightMember = "Height";
-
-this.radDiagram1.ConnectionSourceShapeIdMember = "SourceTaskId";
-this.radDiagram1.ConnectionTargetShapeIdMember = "TargetTaskId";
-this.radDiagram1.ConnectionSourceCapTypeMember = "StartCapField";
-this.radDiagram1.ConnectionTargetCapTypeMember = "EndCapField";
-
-this.radDiagram1.ConnectionSourceConnectorMember = "SourceConnector";
-this.radDiagram1.ConnectionTargetConnectorMember = "TargetConnector";
-
-````
-````VB.NET
-Me.radDiagram1.DataSource = New Source()
-Me.radDiagram1.ConnectionDataMember = "Relations"
-Me.radDiagram1.ShapeDataMember = "Tasks"
-Me.radDiagram1.ShapeIdMember = "Id"
-Me.radDiagram1.ShapeTextMember = "Text"
-Me.radDiagram1.ShapeTypeMember = "Type"
-Me.radDiagram1.ShapeXMember = "X"
-Me.radDiagram1.ShapeYMember = "Y"
-Me.radDiagram1.ShapeWidthMember = "Width"
-Me.radDiagram1.ShapeHeightMember = "Height"
-Me.radDiagram1.ConnectionSourceShapeIdMember = "SourceTaskId"
-Me.radDiagram1.ConnectionTargetShapeIdMember = "TargetTaskId"
-Me.radDiagram1.ConnectionSourceCapTypeMember = "StartCapField"
-Me.radDiagram1.ConnectionTargetCapTypeMember = "EndCapField"
-Me.radDiagram1.ConnectionSourceConnectorMember = "SourceConnector"
-Me.radDiagram1.ConnectionTargetConnectorMember = "TargetConnector"
-
-````
+
+
-{{endregion}}

diff --git a/controls/diagram/data-binding/data-binding-basics.md b/controls/diagram/data-binding/data-binding-basics.md
index 6fb591089..facb5411f 100644
--- a/controls/diagram/data-binding/data-binding-basics.md
+++ b/controls/diagram/data-binding/data-binding-basics.md
@@ -58,108 +58,9 @@ In this article you can check how to data bind __RadDiagram__. To make data bind
* __ConnectionTargetConnectorMember__ – set this to the name of the field that will be used as connector for the target shape for a connection.
-{{source=..\SamplesCS\Diagram\DiagramDataBinding.cs region=DataTable}}
-{{source=..\SamplesVB\Diagram\DiagramDataBinding.vb region=DataTable}}
+
+
-````C#
-
-DataTable tasksTable = new DataTable("Tasks");
-tasksTable.Columns.Add("Id");
-tasksTable.Columns.Add("Text");
-tasksTable.Columns.Add("Type");
-tasksTable.Columns.Add("X");
-tasksTable.Columns.Add("Y");
-tasksTable.Columns.Add("Width");
-tasksTable.Columns.Add("Height");
-tasksTable.Rows.Add("Task1", "Task 1", "circle", 100, 300, 50, 50);
-tasksTable.Rows.Add("Task2", "Task 2", "rectangle", 200, 100, 100, 100);
-tasksTable.Rows.Add("Task3", "Task 3", "circle", 300, 300, 50, 50);
-tasksTable.Rows.Add("Task4", "Task 4", "rectangle", 400, 100, 100, 100);
-tasksTable.Rows.Add("Task5", "Task 5", "circle", 500, 300, 50, 50);
-
-DataTable relationsTable = new DataTable("Relations");
-relationsTable.Columns.Add("SourceTaskId");
-relationsTable.Columns.Add("SourceConnector");
-relationsTable.Columns.Add("TargetTaskId");
-relationsTable.Columns.Add("TargetConnector");
-relationsTable.Columns.Add("StartCapField");
-relationsTable.Columns.Add("EndCapField");
-relationsTable.Rows.Add("Task2", "Left", "Task1", "Auto", "Arrow5Filled", "Arrow1");
-relationsTable.Rows.Add("Task2", "Auto", "Task3", "Auto", "Arrow4Filled", "Arrow1Filled");
-relationsTable.Rows.Add("Task4", "Auto", "Task5", "Auto", "Arrow2Filled", "Arrow2");
-
-DataSet ds = new DataSet();
-ds.Tables.Add(tasksTable);
-ds.Tables.Add(relationsTable);
-
-this.radDiagram1.DataSource = ds;
-
-this.radDiagram1.ConnectionDataMember = "Relations";
-this.radDiagram1.ShapeDataMember = "Tasks";
-this.radDiagram1.ShapeIdMember = "Id";
-this.radDiagram1.ShapeTextMember = "Text";
-this.radDiagram1.ShapeTypeMember = "Type";
-this.radDiagram1.ShapeXMember = "X";
-this.radDiagram1.ShapeYMember = "Y";
-this.radDiagram1.ShapeWidthMember = "Width";
-this.radDiagram1.ShapeHeightMember = "Height";
-
-this.radDiagram1.ConnectionSourceShapeIdMember = "SourceTaskId";
-this.radDiagram1.ConnectionTargetShapeIdMember = "TargetTaskId";
-this.radDiagram1.ConnectionSourceCapTypeMember = "StartCapField";
-this.radDiagram1.ConnectionTargetCapTypeMember = "EndCapField";
-
-this.radDiagram1.ConnectionSourceConnectorMember = "SourceConnector";
-this.radDiagram1.ConnectionTargetConnectorMember = "TargetConnector";
-
-````
-````VB.NET
-Dim tasksTable As New DataTable("Tasks")
-tasksTable.Columns.Add("Id")
-tasksTable.Columns.Add("Text")
-tasksTable.Columns.Add("Type")
-tasksTable.Columns.Add("X")
-tasksTable.Columns.Add("Y")
-tasksTable.Columns.Add("Width")
-tasksTable.Columns.Add("Height")
-tasksTable.Rows.Add("Task1", "Task 1", "circle", 100, 300, 50, 50)
-tasksTable.Rows.Add("Task2", "Task 2", "rectangle", 200, 100, 100, 100)
-tasksTable.Rows.Add("Task3", "Task 3", "circle", 300, 300, 50, 50)
-tasksTable.Rows.Add("Task4", "Task 4", "rectangle", 400, 100, 100, 100)
-tasksTable.Rows.Add("Task5", "Task 5", "circle", 500, 300, 50, 50)
-Dim relationsTable As New DataTable("Relations")
-relationsTable.Columns.Add("SourceTaskId")
-relationsTable.Columns.Add("SourceConnector")
-relationsTable.Columns.Add("TargetTaskId")
-relationsTable.Columns.Add("TargetConnector")
-relationsTable.Columns.Add("StartCapField")
-relationsTable.Columns.Add("EndCapField")
-relationsTable.Rows.Add("Task2", "Left", "Task1", "Auto", "Arrow5Filled", "Arrow1")
-relationsTable.Rows.Add("Task2", "Auto", "Task3", "Auto", "Arrow4Filled", "Arrow1Filled")
-relationsTable.Rows.Add("Task4", "Auto", "Task5", "Auto", "Arrow2Filled", "Arrow2")
-Dim ds As New DataSet()
-ds.Tables.Add(tasksTable)
-ds.Tables.Add(relationsTable)
-Me.RadDiagram1.DataSource = ds
-Me.RadDiagram1.ConnectionDataMember = "Relations"
-Me.RadDiagram1.ShapeDataMember = "Tasks"
-Me.RadDiagram1.ShapeIdMember = "Id"
-Me.RadDiagram1.ShapeTextMember = "Text"
-Me.RadDiagram1.ShapeTypeMember = "Type"
-Me.RadDiagram1.ShapeXMember = "X"
-Me.RadDiagram1.ShapeYMember = "Y"
-Me.RadDiagram1.ShapeWidthMember = "Width"
-Me.RadDiagram1.ShapeHeightMember = "Height"
-Me.RadDiagram1.ConnectionSourceShapeIdMember = "SourceTaskId"
-Me.RadDiagram1.ConnectionTargetShapeIdMember = "TargetTaskId"
-Me.RadDiagram1.ConnectionSourceCapTypeMember = "StartCapField"
-Me.RadDiagram1.ConnectionTargetCapTypeMember = "EndCapField"
-Me.RadDiagram1.ConnectionSourceConnectorMember = "SourceConnector"
-Me.RadDiagram1.ConnectionTargetConnectorMember = "TargetConnector"
-
-````
-
-{{endregion}}

diff --git a/controls/diagram/diagram-factory.md b/controls/diagram/diagram-factory.md
index 25fa93642..a03937e4c 100644
--- a/controls/diagram/diagram-factory.md
+++ b/controls/diagram/diagram-factory.md
@@ -14,203 +14,11 @@ Since **R2 2018 SP1** **RadDiagram** provides means for changing the default sha
If you need to customize any of the **RadDiagram** shapes/connections you can use the **DiagramDataLayerElementProvider** class. It allows you to replace the default elements with custom ones. This can be achieved by creating a **DiagramDataLayerElementProvider** descendant class and overriding the **CreateShape** and **CreateConnection** methods. Then, set the DiagramElement.DataLayer.ElementFactory property before data binding.
-{{source=..\SamplesCS\Diagram\DiagramCustomFactory.cs region=CustomElementProvider}}
-{{source=..\SamplesVB\Diagram\DiagramCustomFactory.vb region=CustomElementProvider}}
+
+
-````C#
-
-public partial class DiagramCustomFactory : Form
-{
- public DiagramCustomFactory()
- {
- InitializeComponent();
-
- this.radDiagram1.DiagramElement.DataLayer.ElementFactory = new CustomDiagramDataLayerElementProvider();
-
- Bind();
-
- foreach (MyCustomShape shape in this.radDiagram1.Shapes)
- {
- Console.WriteLine(shape.CreatedOn);
- }
-
- foreach (MyCustomRadDiagramConnection connection in this.radDiagram1.Connections)
- {
- Console.WriteLine(connection.CreatedOn);
- }
- }
-
- private void Bind()
- {
- DataTable tasksTable = new DataTable("Tasks");
- tasksTable.Columns.Add("Id");
- tasksTable.Columns.Add("Text");
- tasksTable.Columns.Add("Type");
- tasksTable.Columns.Add("X");
- tasksTable.Columns.Add("Y");
- tasksTable.Columns.Add("Width");
- tasksTable.Columns.Add("Height");
- tasksTable.Rows.Add("Task1", "Task 1", "circle", 100, 300, 50, 50);
- tasksTable.Rows.Add("Task2", "Task 2", "rectangle", 200, 100, 100, 100);
- tasksTable.Rows.Add("Task3", "Task 3", "circle", 300, 300, 50, 50);
- tasksTable.Rows.Add("Task4", "Task 4", "rectangle", 400, 100, 100, 100);
- tasksTable.Rows.Add("Task5", "Task 5", "circle", 500, 300, 50, 50);
-
- DataTable relationsTable = new DataTable("Relations");
- relationsTable.Columns.Add("SourceTaskId");
- relationsTable.Columns.Add("SourceConnector");
- relationsTable.Columns.Add("TargetTaskId");
- relationsTable.Columns.Add("TargetConnector");
- relationsTable.Columns.Add("StartCapField");
- relationsTable.Columns.Add("EndCapField");
- relationsTable.Rows.Add("Task2", "Left", "Task1", "Auto", "Arrow5Filled", "Arrow1");
- relationsTable.Rows.Add("Task2", "Auto", "Task3", "Auto", "Arrow4Filled", "Arrow1Filled");
- relationsTable.Rows.Add("Task4", "Auto", "Task5", "Auto", "Arrow2Filled", "Arrow2");
-
- DataSet ds = new DataSet();
- ds.Tables.Add(tasksTable);
- ds.Tables.Add(relationsTable);
-
- this.radDiagram1.DataSource = ds;
-
- this.radDiagram1.ConnectionDataMember = "Relations";
- this.radDiagram1.ShapeDataMember = "Tasks";
- this.radDiagram1.ShapeIdMember = "Id";
- this.radDiagram1.ShapeTextMember = "Text";
- this.radDiagram1.ShapeTypeMember = "Type";
- this.radDiagram1.ShapeXMember = "X";
- this.radDiagram1.ShapeYMember = "Y";
- this.radDiagram1.ShapeWidthMember = "Width";
- this.radDiagram1.ShapeHeightMember = "Height";
-
- this.radDiagram1.ConnectionSourceShapeIdMember = "SourceTaskId";
- this.radDiagram1.ConnectionTargetShapeIdMember = "TargetTaskId";
- this.radDiagram1.ConnectionSourceCapTypeMember = "StartCapField";
- this.radDiagram1.ConnectionTargetCapTypeMember = "EndCapField";
-
- this.radDiagram1.ConnectionSourceConnectorMember = "SourceConnector";
- this.radDiagram1.ConnectionTargetConnectorMember = "TargetConnector";
- }
-}
-
-public class MyCustomShape : RadDiagramShape
-{
- public DateTime CreatedOn { get; set; }
-
- public MyCustomShape()
- {
- this.CreatedOn = DateTime.Now;
- }
-}
-
-public class MyCustomRadDiagramConnection : RadDiagramConnection
-{
- public DateTime CreatedOn { get; set; }
-
- public MyCustomRadDiagramConnection()
- {
- this.CreatedOn = DateTime.Now;
- }
-}
-
-public class CustomDiagramDataLayerElementProvider : DiagramDataLayerElementProvider
-{
- public override RadDiagramShape CreateShape()
- {
- return new MyCustomShape();
- }
-
- public override RadDiagramConnection CreateConnection()
- {
- return new MyCustomRadDiagramConnection();
- }
-}
-````
-````VB.NET
-Sub New()
- InitializeComponent()
- Me.RadDiagram1.DiagramElement.DataLayer.ElementFactory = New CustomDiagramDataLayerElementProvider()
- Bind()
- For Each shape As MyCustomShape In Me.RadDiagram1.Shapes
- Console.WriteLine(shape.CreatedOn)
- Next
- For Each connection As MyCustomRadDiagramConnection In Me.RadDiagram1.Connections
- Console.WriteLine(connection.CreatedOn)
- Next
-End Sub
-Private Sub Bind()
- Dim tasksTable As DataTable = New DataTable("Tasks")
- tasksTable.Columns.Add("Id")
- tasksTable.Columns.Add("Text")
- tasksTable.Columns.Add("Type")
- tasksTable.Columns.Add("X")
- tasksTable.Columns.Add("Y")
- tasksTable.Columns.Add("Width")
- tasksTable.Columns.Add("Height")
- tasksTable.Rows.Add("Task1", "Task 1", "circle", 100, 300, 50, 50)
- tasksTable.Rows.Add("Task2", "Task 2", "rectangle", 200, 100, 100, 100)
- tasksTable.Rows.Add("Task3", "Task 3", "circle", 300, 300, 50, 50)
- tasksTable.Rows.Add("Task4", "Task 4", "rectangle", 400, 100, 100, 100)
- tasksTable.Rows.Add("Task5", "Task 5", "circle", 500, 300, 50, 50)
- Dim relationsTable As DataTable = New DataTable("Relations")
- relationsTable.Columns.Add("SourceTaskId")
- relationsTable.Columns.Add("SourceConnector")
- relationsTable.Columns.Add("TargetTaskId")
- relationsTable.Columns.Add("TargetConnector")
- relationsTable.Columns.Add("StartCapField")
- relationsTable.Columns.Add("EndCapField")
- relationsTable.Rows.Add("Task2", "Left", "Task1", "Auto", "Arrow5Filled", "Arrow1")
- relationsTable.Rows.Add("Task2", "Auto", "Task3", "Auto", "Arrow4Filled", "Arrow1Filled")
- relationsTable.Rows.Add("Task4", "Auto", "Task5", "Auto", "Arrow2Filled", "Arrow2")
- Dim ds As DataSet = New DataSet()
- ds.Tables.Add(tasksTable)
- ds.Tables.Add(relationsTable)
- Me.RadDiagram1.DataSource = ds
- Me.RadDiagram1.ConnectionDataMember = "Relations"
- Me.RadDiagram1.ShapeDataMember = "Tasks"
- Me.RadDiagram1.ShapeIdMember = "Id"
- Me.RadDiagram1.ShapeTextMember = "Text"
- Me.RadDiagram1.ShapeTypeMember = "Type"
- Me.RadDiagram1.ShapeXMember = "X"
- Me.RadDiagram1.ShapeYMember = "Y"
- Me.RadDiagram1.ShapeWidthMember = "Width"
- Me.RadDiagram1.ShapeHeightMember = "Height"
- Me.RadDiagram1.ConnectionSourceShapeIdMember = "SourceTaskId"
- Me.RadDiagram1.ConnectionTargetShapeIdMember = "TargetTaskId"
- Me.RadDiagram1.ConnectionSourceCapTypeMember = "StartCapField"
- Me.RadDiagram1.ConnectionTargetCapTypeMember = "EndCapField"
- Me.RadDiagram1.ConnectionSourceConnectorMember = "SourceConnector"
- Me.RadDiagram1.ConnectionTargetConnectorMember = "TargetConnector"
-End Sub
-Class
-ic Class MyCustomShape
-rits RadDiagramShape
-Public Property CreatedOn As DateTime
-Public Sub New()
- Me.CreatedOn = DateTime.Now
-End Sub
-Class
-ic Class MyCustomRadDiagramConnection
-rits RadDiagramConnection
-Public Property CreatedOn As DateTime
-Public Sub New()
- Me.CreatedOn = DateTime.Now
-End Sub
-Class
-ic Class CustomDiagramDataLayerElementProvider
-rits DiagramDataLayerElementProvider
-Public Overrides Function CreateShape() As RadDiagramShape
- Return New MyCustomShape()
-End Function
-Public Overrides Function CreateConnection() As RadDiagramConnection
- Return New MyCustomRadDiagramConnection()
-End Function
-Class
-````
-
-{{endregion}}
# See Also
diff --git a/controls/diagram/diagram-items/connections/cap-types.md b/controls/diagram/diagram-items/connections/cap-types.md
index 69b635b78..ac82747ca 100644
--- a/controls/diagram/diagram-items/connections/cap-types.md
+++ b/controls/diagram/diagram-items/connections/cap-types.md
@@ -16,22 +16,10 @@ __CapType__ enumeration members:

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=CapTypeNone}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=CapTypeNone}}
+
+
-````C#
-
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.None;
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.None;
-````
-````VB.NET
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.None
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.None
-
-````
-
-{{endregion}}
@@ -40,21 +28,10 @@ connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.None

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=CapTypeArrow1}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=CapTypeArrow1}}
-
-````C#
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1;
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1;
+
+
-````
-````VB.NET
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1
-````
-
-{{endregion}}
* __Arrow1Filled__:
@@ -62,109 +39,52 @@ connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=CapTypeArrow1Filled}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=CapTypeArrow1Filled}}
-
-````C#
-
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1Filled;
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1Filled;
-
-````
-````VB.NET
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1Filled
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1Filled
+
+
-````
-{{endregion}}
* __Arrow2__:

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=CapTypeArrow2}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=CapTypeArrow2}}
+
+
-````C#
-
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow2;
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow2;
-````
-````VB.NET
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow2
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow2
-
-````
-
-{{endregion}}
* __Arrow2Filled__:

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=CapTypeArrow2Filled}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=CapTypeArrow2Filled}}
-
-````C#
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow2Filled;
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow2Filled;
+
+
-````
-````VB.NET
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow2Filled
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow2Filled
-````
-{{endregion}}
* __Arrow3__:

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=CapTypeArrow3}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=CapTypeArrow3}}
+
+
-````C#
-
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow3;
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow3;
-````
-````VB.NET
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow3
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow3
-````
-
-{{endregion}}
* __Arrow4__:

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=CapTypeArrow4}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=CapTypeArrow4}}
-
-````C#
-
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow4;
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow4;
+
+
-````
-````VB.NET
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow4
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow4
-````
-
-{{endregion}}
* __Arrow4Filled__:
@@ -172,87 +92,39 @@ connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow4

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=CapTypeArrow4Filled}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=CapTypeArrow4Filled}}
-
-````C#
-
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow4Filled;
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow4Filled;
-
-````
-````VB.NET
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow4Filled
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow4Filled
+
+
-````
-{{endregion}}
* __Arrow5__:

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=CapTypeArrow5}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=CapTypeArrow5}}
+
+
-````C#
-
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow5;
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow5;
-````
-````VB.NET
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow5
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow5
-
-````
-
-{{endregion}}
* __Arrow5Filled__:

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=CapTypeArrow5Filled}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=CapTypeArrow5Filled}}
-
-````C#
-
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow5Filled;
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow5Filled;
+
+
-````
-````VB.NET
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow5Filled
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow5Filled
-````
-
-{{endregion}}
* __Arrow6__:

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=CapTypeArrow6}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=CapTypeArrow6}}
-
-````C#
-
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow6;
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow6;
-
-````
-````VB.NET
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow6
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow6
+
+
-````
-{{endregion}}
@@ -261,19 +133,7 @@ connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow6

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=CapTypeArrow6Filled}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=CapTypeArrow6Filled}}
-
-````C#
-
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow6Filled;
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow6Filled;
-
-````
-````VB.NET
-connection1.SourceCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow6Filled
-connection1.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow6Filled
+
+
-````
-{{endregion}}
diff --git a/controls/diagram/diagram-items/connections/connection-types.md b/controls/diagram/diagram-items/connections/connection-types.md
index 1ace18278..bc1d423ca 100644
--- a/controls/diagram/diagram-items/connections/connection-types.md
+++ b/controls/diagram/diagram-items/connections/connection-types.md
@@ -12,31 +12,10 @@ position: 1
* __ConnectionPoints__ - if you want to change the route of the connection, you can add connection points in code-behind through the RadDiagramConnection.__ConnectionPoints__ property. You can populate the __ConnectionPoints__ collection with objects of type *Point*:
-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=AddConnection}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=AddConnection}}
+
+
-````C#
-
-RadDiagramConnection connection1 = new RadDiagramConnection() { Name = "connection1" };
-
-connection1.Source = shape1;
-connection1.Target = starShape;
-connection1.ConnectionPoints.Add(new Point(200, 30));
-radDiagram1.Items.Add(connection1);
-
-````
-````VB.NET
-Dim connection1 As New RadDiagramConnection() With { _
- .Name = "connection1" _
-}
-connection1.Source = shape1
-connection1.Target = starShape
-connection1.ConnectionPoints.Add(New Point(200, 30))
-RadDiagram1.Items.Add(connection1)
-````
-
-{{endregion}}

@@ -53,86 +32,19 @@ RadDiagram1.Items.Add(connection1)

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=PolylineConnection}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=PolylineConnection}}
+
+
-````C#
-
-RadDiagramShape sourceShape = new RadDiagramShape()
-{
- Text = "source",
- Shape = new RoundRectShape(5),
- BackColor = Color.Red
-};
-
-sourceShape.Position = new Telerik.Windows.Diagrams.Core.Point(150, 100);
-radDiagram1.AddShape(sourceShape);
-
-RadDiagramShape targetShape = new RadDiagramShape()
-{
- Text = "target",
- Shape = new RoundRectShape(5),
- BackColor = Color.Red
-};
-
-targetShape.Position = new Telerik.Windows.Diagrams.Core.Point(400, 300);
-radDiagram1.AddShape(targetShape);
-
-RadDiagramConnection polylineConnection = new RadDiagramConnection() { Name = "connection1" };
-
-polylineConnection.Source = sourceShape;
-polylineConnection.Target = targetShape;
-polylineConnection.ConnectionType = Telerik.Windows.Diagrams.Core.ConnectionType.Polyline;
-radDiagram1.AddShape(polylineConnection);
-
-````
-````VB.NET
-Dim sourceShape As New RadDiagramShape() With { _
- .Text = "source", _
- .Shape = New RoundRectShape(5), _
- .BackColor = Color.Red _
-}
-sourceShape.Position = New Telerik.Windows.Diagrams.Core.Point(150, 100)
-RadDiagram1.AddShape(sourceShape)
-Dim targetShape As New RadDiagramShape() With { _
- .Text = "target", _
- .Shape = New RoundRectShape(5), _
- .BackColor = Color.Red _
-}
-targetShape.Position = New Telerik.Windows.Diagrams.Core.Point(400, 300)
-RadDiagram1.AddShape(targetShape)
-Dim polylineConnection As New RadDiagramConnection() With { _
- .Name = "connection1" _
-}
-polylineConnection.Source = sourceShape
-polylineConnection.Target = targetShape
-polylineConnection.ConnectionType = Telerik.Windows.Diagrams.Core.ConnectionType.Polyline
-RadDiagram1.Items.Add(polylineConnection)
-
-````
-
-{{endregion}}
-If you want to change the route of the connection, you can add connection points in code-behind through the RadDiagramConnection.__ConnectionPoints__ property. You can populate the __ConnectionPoints__ collection with objects of type Point:
+If you want to change the route of the connection, you can add connection points in code-behind through the RadDiagramConnection.__ConnectionPoints__ property. You can populate the __ConnectionPoints__ collection with objects of type Point:
-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=ConnectionPolylineWithPoints}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=ConnectionPolylineWithPoints}}
-
-````C#
-
-polylineConnection.ConnectionPoints.Add(new Point(300, 140));
-polylineConnection.ConnectionPoints.Add(new Point(330, 280));
-````
-````VB.NET
-polylineConnection.ConnectionPoints.Add(New Point(300, 140))
-polylineConnection.ConnectionPoints.Add(New Point(330, 280))
+
+
-````
-{{endregion}}
Sample of a curved Polyline connection:
@@ -145,33 +57,10 @@ Sample of a curved Polyline connection:

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=BezierConnection}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=BezierConnection}}
-
-````C#
-
-RadDiagramConnection bezierConnection = new RadDiagramConnection() { Name = "connection1" };
-
-bezierConnection.Source = sourceShape;
-bezierConnection.Target = targetShape;
-bezierConnection.BezierTension = 16;
-bezierConnection.ConnectionType = Telerik.Windows.Diagrams.Core.ConnectionType.Bezier;
-radDiagram1.Items.Add(bezierConnection);
-
-````
-````VB.NET
-Dim bezierConnection As New RadDiagramConnection() With { _
- .Name = "connection1" _
-}
-bezierConnection.Source = sourceShape
-bezierConnection.Target = targetShape
-bezierConnection.BezierTension = 16
-bezierConnection.ConnectionType = Telerik.Windows.Diagrams.Core.ConnectionType.Bezier
-RadDiagram1.Items.Add(bezierConnection)
+
+
-````
-{{endregion}}
By default, when you create a Bezier connection and attach its endpoints to __RadDiagramShapes__, the position of the handle points of the connection will be calculated based on the connector positions. Both handle points will be added to the RadDiagramConnection.__ConnectionPoints__ collection. The following snapshot illustrates the default direction of the Bezier connection handles based on the position of the connector to which the connection is attached.
@@ -193,34 +82,7 @@ The offset between a Bezier connection handle point and its corresponding endpoi

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=SplineConnection}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=SplineConnection}}
+
+
+
-````C#
-
-RadDiagramConnection splineConnection = new RadDiagramConnection() { Name = "connection1" };
-
-splineConnection.Source = sourceShape;
-splineConnection.Target = targetShape;
-splineConnection.ConnectionType = Telerik.Windows.Diagrams.Core.ConnectionType.Spline;
-splineConnection.ConnectionPoints.Add(new Point(140, 20));
-splineConnection.ConnectionPoints.Add(new Point(250, 150));
-splineConnection.ConnectionPoints.Add(new Point(350, 50));
-radDiagram1.Items.Add(splineConnection);
-
-````
-````VB.NET
-Dim splineConnection As New RadDiagramConnection() With { _
- .Name = "connection1" _
-}
-splineConnection.Source = sourceShape
-splineConnection.Target = targetShape
-splineConnection.ConnectionType = Telerik.Windows.Diagrams.Core.ConnectionType.Spline
-splineConnection.ConnectionPoints.Add(New Point(140, 20))
-splineConnection.ConnectionPoints.Add(New Point(250, 150))
-splineConnection.ConnectionPoints.Add(New Point(350, 50))
-RadDiagram1.Items.Add(splineConnection)
-
-````
-
-{{endregion}}
diff --git a/controls/diagram/diagram-items/connections/connections.md b/controls/diagram/diagram-items/connections/connections.md
index b2edd162c..e9cce2c98 100644
--- a/controls/diagram/diagram-items/connections/connections.md
+++ b/controls/diagram/diagram-items/connections/connections.md
@@ -69,20 +69,10 @@ You can label a connection by setting its __Content__ property.

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=Content}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=Content}}
+
+
-````C#
-
-connection1.Content = "connection label";
-
-````
-````VB.NET
-connection1.Content = "connection label"
-````
-
-{{endregion}}
## Customize the Connection Appearance
@@ -93,39 +83,20 @@ You can easily customize the visual appearance of the __RadDiagramConnection__ b

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=ConnectionBackColor}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=ConnectionBackColor}}
+
+
-````C#
-
-connection1.BackColor = Color.Red;
-````
-````VB.NET
-connection1.BackColor = Color.Red
-
-````
-
-{{endregion}}
* __StrokeThickness__: gets or sets the width of the __RadDiagramConnection__ outline.

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=StrokeThickness}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=StrokeThickness}}
-
-````C#
-connection1.StrokeThickness = 5;
+
+
-````
-````VB.NET
-connection1.StrokeThickness = 5
-````
-
-{{endregion}}
@@ -134,43 +105,19 @@ connection1.StrokeThickness = 5

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=ConnectionForeColor}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=ConnectionForeColor}}
-
-````C#
-
-connection1.ForeColor = Color.Blue;
-
-````
-````VB.NET
-connection1.ForeColor = Color.Blue
+
+
-````
-{{endregion}}
* __StrokeDashArray__: gets or sets a collection of Double values that indicate the pattern of dashes and gaps that is used to outline the __RadDiagramConnection__.
-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=StrokeDashArray}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=StrokeDashArray}}
-
-````C#
-connection1.StrokeDashArray = new Telerik.WinControls.UI.Diagrams.DoubleCollection(new List { 2, 2, 2, 2 });
-
-````
-````VB.NET
-connection1.StrokeDashArray = New Telerik.WinControls.UI.Diagrams.DoubleCollection(New List(Of Single)() From { _
- 2, _
- 2, _
- 2, _
- 2 _
-})
+
+
-````
-{{endregion}}

diff --git a/controls/diagram/diagram-items/containershapes.md b/controls/diagram/diagram-items/containershapes.md
index 1e043d9ae..e59d3cf86 100644
--- a/controls/diagram/diagram-items/containershapes.md
+++ b/controls/diagram/diagram-items/containershapes.md
@@ -32,24 +32,10 @@ A container can be connected and handled like other shapes.
__RadDiagramContainerShape__ header is controlled via the __Content__ property:
-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=ContainersContent}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=ContainersContent}}
+
+
-````C#
-
-RadDiagramContainerShape container = new RadDiagramContainerShape();
-container.Content = "Container header";
-this.radDiagram1.Items.Add(container);
-
-````
-````VB.NET
-Dim container As New RadDiagramContainerShape()
-container.Content = "Container header"
-Me.RadDiagram1.Items.Add(container)
-
-````
-{{endregion}}
@@ -70,44 +56,10 @@ The main purpose of the __RadDiagramContainerShape__ is to allow you to drop sha
You can also populate it manually in code-behind:
-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=ContainerItems}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=ContainerItems}}
+
+
+
-````C#
-
-RadDiagramShape shape = new RadDiagramShape()
-{
- Text = "Shape1",
- Shape = new RoundRectShape(4),
- BackColor = Color.LimeGreen
-};
-shape.Position = new Telerik.Windows.Diagrams.Core.Point(100, 100);
-
-RadDiagramContainerShape containerShape = new RadDiagramContainerShape();
-containerShape.Content = "Container header";
-containerShape.Location = new Point(10,10);
-containerShape.DrawBorder = true;
-this.radDiagram1.Items.Add(containerShape);
-containerShape.Items.Add(shape);
-
-````
-````VB.NET
-Dim shape As New RadDiagramShape() With { _
- .Text = "Shape1", _
- .Shape = New RoundRectShape(4), _
- .BackColor = Color.LimeGreen _
-}
-shape.Position = New Telerik.Windows.Diagrams.Core.Point(100, 100)
-Dim containerShape As New RadDiagramContainerShape()
-containerShape.Content = "Container header"
-containerShape.Location = New Point(10, 10)
-containerShape.DrawBorder = True
-Me.RadDiagram1.Items.Add(containerShape)
-containerShape.Items.Add(shape)
-
-````
-
-{{endregion}}
>caption Figure 3: RadDiagramContainerShape.Items
@@ -168,24 +120,10 @@ You can easily customize the visual appearance of the __RadDiagramContainerShape
#### RadDiagramContainerShape's appearance
-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=ContainerAppearance}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=ContainerAppearance}}
-
-````C#
-
-container.BackColor = Color.Yellow;
-container.BorderThickness = new Padding(3);
-container.BorderBrush = new System.Drawing.SolidBrush(Color.Fuchsia);
-
-````
-````VB.NET
-container.BackColor = Color.Yellow
-container.BorderThickness = New System.Windows.Forms.Padding(3)
-container.BorderBrush = New System.Drawing.SolidBrush(Color.Fuchsia)
+
+
-````
-{{endregion}}
diff --git a/controls/diagram/diagram-items/shapes.md b/controls/diagram/diagram-items/shapes.md
index dfaaabb62..f5e052b43 100644
--- a/controls/diagram/diagram-items/shapes.md
+++ b/controls/diagram/diagram-items/shapes.md
@@ -23,63 +23,15 @@ __RadDiagramShape__ is an object that describes the nodes of the diagram. You ca

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=SetAShape}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=SetAShape}}
+
+
+
+
+
+
+
+
-````C#
-
-RadDiagramShape shape1 = new RadDiagramShape()
-{
- Text = "",
- Shape = new AShape(),
- BackColor = Color.LimeGreen
-};
-shape1.Position = new Telerik.Windows.Diagrams.Core.Point(100, 100);
-radDiagram1.AddShape(shape1);
-
-````
-````VB.NET
-Dim shape1 As New RadDiagramShape() With { _
- .Text = "", _
- .Shape = New AShape(), _
- .BackColor = Color.LimeGreen _
-}
-shape1.Position = New Telerik.Windows.Diagrams.Core.Point(100, 100)
-RadDiagram1.AddShape(shape1)
-
-````
-
-{{endregion}}
-
-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=AShape}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=AShape}}
-
-````C#
-
-public class AShape : ElementShape
-{
- public override GraphicsPath CreatePath(Rectangle bounds)
- {
- GraphicsPath path = new GraphicsPath();
- path.AddString("A", new FontFamily("Arial"), 0, 122, Point.Empty, StringFormat.GenericTypographic);
- return path;
- }
-}
-
-````
-````VB.NET
-Public Class AShape
-Inherits ElementShape
- Public Overrides Function CreatePath(bounds As Rectangle) As GraphicsPath
- Dim path As New GraphicsPath()
- path.AddString("A", New FontFamily("Arial"), 0, 122, Point.Empty, StringFormat.GenericTypographic)
- Return path
- End Function
-End Class
-
-````
-
-{{endregion}}
@@ -88,33 +40,10 @@ or to use one of the pre-defined shapes:

-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=StarShape}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=StarShape}}
+
+
+
-````C#
-
-RadDiagramShape starShape = new RadDiagramShape()
-{
- Text = "",
- Shape = new StarShape(),
- BackColor = Color.LimeGreen
-};
-starShape.Position = new Telerik.Windows.Diagrams.Core.Point(400, 100);
-radDiagram1.AddShape(starShape);
-
-````
-````VB.NET
-Dim starShape As New RadDiagramShape() With { _
- .Text = "", _
- .Shape = New StarShape(), _
- .BackColor = Color.LimeGreen _
-}
-starShape.Position = New Telerik.Windows.Diagrams.Core.Point(100, 100)
-RadDiagram1.AddShape(starShape)
-
-````
-
-{{endregion}}
>note A list of pre-defined shapes is available here: [Shapes](https://docs.telerik.com/devtools/winforms/controls/diagram/diagram-items/shapes)
@@ -194,22 +123,10 @@ You can easily customize the visual appearance of the __RadDiagramShape__ by usi
* __BorderBrush__- gets or sets the brush that specifies the __RadDiagramShape__ border color if the __DrawBorder__ property is set to *true*.
-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=ShapeBorder}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=ShapeBorder}}
+
+
-````C#
-
-shape1.BorderBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Red);
-shape1.DrawBorder = true;
-
-````
-````VB.NET
-shape1.BorderBrush = New System.Drawing.SolidBrush(System.Drawing.Color.Red)
-shape1.DrawBorder = True
-````
-
-{{endregion}}
@@ -219,26 +136,10 @@ shape1.DrawBorder = True
* __StrokeDashArray__ - gets or sets a collection of Double values that indicate the pattern of dashes and gaps that is used to outline the __RadDiagramShape__.
-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=BorderStroke}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=BorderStroke}}
-
-````C#
-
-shape.StrokeDashArray = new Telerik.WinControls.UI.Diagrams.DoubleCollection(new List { 2, 2, 2, 2 });
-
-````
-````VB.NET
-
-shape.StrokeDashArray = New Telerik.WinControls.UI.Diagrams.DoubleCollection(New List(Of Single)() From { _
- 2, _
- 2, _
- 2, _
- 2 _
-})
+
+
-````
-{{endregion}}
>caption Figure 6: StrokeDashArray
diff --git a/controls/diagram/diagram-tools/text-tool.md b/controls/diagram/diagram-tools/text-tool.md
index 55e48c889..57ae7aa5c 100644
--- a/controls/diagram/diagram-tools/text-tool.md
+++ b/controls/diagram/diagram-tools/text-tool.md
@@ -15,20 +15,9 @@ The __TextTool__ allows you to enter the edit mode of a __RadDiagramItem__ as so
#### Active Tool
-{{source=..\SamplesCS\Diagram\DiagramPopulatingWithData.cs region=ActiveTool}}
-{{source=..\SamplesVB\Diagram\DiagramPopulatingWithData.vb region=ActiveTool}}
+
+
-````C#
-
-this.radDiagram1.ActiveTool = Telerik.Windows.Diagrams.Core.MouseTool.TextTool;
-
-````
-````VB.NET
-Me.RadDiagram1.ActiveTool = Telerik.Windows.Diagrams.Core.MouseTool.TextTool
-
-````
-
-{{endregion}}
Let's consider we already have a shape in __RadDiagram__. As soon as you click on the shape, you will enter its edit mode. This way you can easily modify its content.
diff --git a/controls/diagram/drag-and-drop/drag-and-drop-from-another-control.md b/controls/diagram/drag-and-drop/drag-and-drop-from-another-control.md
index 51f86e96c..e760812c8 100644
--- a/controls/diagram/drag-and-drop/drag-and-drop-from-another-control.md
+++ b/controls/diagram/drag-and-drop/drag-and-drop-from-another-control.md
@@ -22,319 +22,30 @@ The drag and drop behavior in __RadGridView__ is controlled by a service class.
#### Setup RadGridView
-{{source=..\SamplesCS\Diagram\DiagramDragAndDropGrid.cs region=SetupGrid}}
-{{source=..\SamplesVB\Diagram\DiagramDragAndDropGrid.vb region=SetupGrid}}
-````C#
-public DiagramDragAndDropGrid()
-{
- InitializeComponent();
- BaseGridBehavior gridBehavior = this.radGridView1.GridBehavior as BaseGridBehavior;
- gridBehavior.UnregisterBehavior(typeof(GridViewDataRowInfo));
- gridBehavior.RegisterBehavior(typeof(GridViewDataRowInfo), new CustomRowGridBehavior());
- this.radGridView1.DataSource = this.GetData();
- this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
- RadGridViewDragDropService svc = this.radGridView1.GridViewElement.GetService();
- svc.PreviewDragDrop += svc_PreviewDragDrop;
- svc.PreviewDragOver += svc_PreviewDragOver;
- svc.PreviewDragStart += svc_PreviewDragStart;
-}
-private BindingList GetData()
-{
- Color[] colors = new Color[] { Color.LightBlue, Color.LightGreen, Color.LightYellow, Color.LightCoral, Color.LightGray, Color.LightCyan };
- string[] shapes = new string[] { "RoundRect", "Diamond", "Star", "Heart", "Media", "Donut" };
- BindingList data = new BindingList();
- for (int i = 0; i < shapes.Length; i++)
- {
- data.Add(new GridModel
- {
- Id = i + 1,
- Color = colors[i],
- Shape = shapes[i]
- });
- }
- return data;
-}
+
+
-````
-````VB.NET
-Sub New()
- InitializeComponent()
- Dim gridBehavior As BaseGridBehavior = TryCast(Me.RadGridView1.GridBehavior, BaseGridBehavior)
- gridBehavior.UnregisterBehavior(GetType(GridViewDataRowInfo))
- gridBehavior.RegisterBehavior(GetType(GridViewDataRowInfo), New CustomRowGridBehavior())
- Me.RadGridView1.DataSource = Me.GetData()
- Me.RadGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill
- Dim svc As RadGridViewDragDropService = Me.RadGridView1.GridViewElement.GetService(Of RadGridViewDragDropService)()
- AddHandler svc.PreviewDragDrop, AddressOf svc_PreviewDragDrop
- AddHandler svc.PreviewDragOver, AddressOf svc_PreviewDragOver
- AddHandler svc.PreviewDragStart, AddressOf svc_PreviewDragStart
-End Sub
-Private Function GetData() As BindingList(Of GridModel)
- Dim colors As Color() = New Color() {Color.LightBlue, Color.LightGreen, Color.LightYellow, Color.LightCoral, Color.LightGray, Color.LightCyan}
- Dim shapes As String() = New String() {"RoundRect", "Diamond", "Star", "Heart", "Media", "Donut"}
- Dim data As New BindingList(Of GridModel)()
- For i As Integer = 0 To shapes.Length - 1
- data.Add(New GridModel() With {
- .Id = i + 1,
- .Color = colors(i),
- .Shape = shapes(i)
- })
- Next
- Return data
-End Function
-````
-
-
-
-{{endregion}}
For the purpose of the example we will define a grid model object storing information about the shapes.
#### Grid Helpers
-{{source=..\SamplesCS\Diagram\DiagramDragAndDropGrid.cs region=HelperClasses}}
-{{source=..\SamplesVB\Diagram\DiagramDragAndDropGrid.vb region=HelperClasses}}
-````C#
-public class GridModel
-{
- public int Id { get; set; }
- public Color Color { get; set; }
- public string Shape { get; set; }
-}
-public class CustomRowGridBehavior : GridDataRowBehavior
-{
- protected override bool OnMouseDownLeft(MouseEventArgs e)
- {
- GridDataRowElement row = this.GetRowAtPoint(e.Location) as GridDataRowElement;
- if (row != null)
- {
- RadGridViewDragDropService svc = this.GridViewElement.GetService();
- svc.Start(row);
- }
- return base.OnMouseDownLeft(e);
- }
-}
-
-````
-````VB.NET
-Public Class GridModel
- Public Property Id() As Integer
- Get
- Return m_Id
- End Get
- Set(value As Integer)
- m_Id = value
- End Set
- End Property
- Private m_Id As Integer
- Public Property Color() As Color
- Get
- Return m_Color
- End Get
- Set(value As Color)
- m_Color = value
- End Set
- End Property
- Private m_Color As Color
- Public Property Shape() As String
- Get
- Return m_Shape
- End Get
- Set(value As String)
- m_Shape = value
- End Set
- End Property
- Private m_Shape As String
-End Class
-Public Class CustomRowGridBehavior
- Inherits GridDataRowBehavior
- Protected Overrides Function OnMouseDownLeft(e As MouseEventArgs) As Boolean
- Dim row As GridDataRowElement = TryCast(Me.GetRowAtPoint(e.Location), GridDataRowElement)
- If row IsNot Nothing Then
- Dim svc As RadGridViewDragDropService = Me.GridViewElement.GetService(Of RadGridViewDragDropService)()
- svc.Start(row)
- End If
- Return MyBase.OnMouseDownLeft(e)
- End Function
-End Class
-
-````
+
+
-{{endregion}}
-
## Handling Events
__RadDiagram__ will accept the dragged data only if it is dropped on the diagram element. The __PreviewDragDrop__ event handler will be responsible for reading the data and transforming it to a shape.
#### Drag and Drop Events
-{{source=..\SamplesCS\Diagram\DiagramDragAndDropGrid.cs region=HandleEvents}}
-{{source=..\SamplesVB\Diagram\DiagramDragAndDropGrid.vb region=HandleEvents}}
-````C#
-private void svc_PreviewDragStart(object sender, PreviewDragStartEventArgs e)
-{
- e.CanStart = true;
-}
-private void svc_PreviewDragOver(object sender, RadDragOverEventArgs e)
-{
- if (e.DragInstance is GridDataRowElement)
- {
- e.CanDrop = e.HitTarget is RadDiagramElement;
- }
-}
-private void svc_PreviewDragDrop(object sender, RadDropEventArgs e)
-{
- RadDiagramElement targetElement = e.HitTarget as RadDiagramElement;
- GridDataRowElement draggedRow = e.DragInstance as GridDataRowElement;
- if (draggedRow == null)
- {
- return;
- }
- GridModel data = (GridModel)draggedRow.Data.DataBoundItem;
- RadDiagramShape shape = new RadDiagramShape()
- {
- Text = data.Shape,
- ElementShape = this.GetShapeFromModel(data),
- BackColor = data.Color
- };
- shape.Position = e.DropLocation;
- this.radDiagram1.AddShape(shape);
-}
-private ElementShape GetShapeFromModel(GridModel data)
-{
- ElementShape shape = null;
- switch (data.Shape)
- {
- case "RoundRect":
- shape = new RoundRectShape();
- break;
- case "Diamond":
- shape = new DiamondShape();
- break;
- case "Star":
- shape = new StarShape();
- break;
- case "Heart":
- shape = new HeartShape();
- break;
- case "Media":
- shape = new MediaShape();
- break;
- case "Donut":
- shape = new DonutShape();
- break;
- default:
- shape = new CustomShape();
- break;
- }
- return shape;
-}
-
-````
-````VB.NET
-Private Sub svc_PreviewDragStart(sender As Object, e As PreviewDragStartEventArgs)
- e.CanStart = True
-End Sub
-Private Sub svc_PreviewDragOver(sender As Object, e As RadDragOverEventArgs)
- If TypeOf e.DragInstance Is GridDataRowElement Then
- e.CanDrop = TypeOf e.HitTarget Is RadDiagramElement
- End If
-End Sub
-Private Sub svc_PreviewDragDrop(sender As Object, e As RadDropEventArgs)
- Dim targetElement As RadDiagramElement = TryCast(e.HitTarget, RadDiagramElement)
- Dim draggedRow As GridDataRowElement = TryCast(e.DragInstance, GridDataRowElement)
- If draggedRow Is Nothing Then
- Return
- End If
- Dim data As GridModel = DirectCast(draggedRow.Data.DataBoundItem, GridModel)
- Dim shape As New RadDiagramShape() With {
- .Text = data.Shape,
- .ElementShape = Me.GetShapeFromModel(data),
- .BackColor = data.Color
- }
- shape.Position = e.DropLocation
- Me.RadDiagram1.AddShape(shape)
-End Sub
-Private Function GetShapeFromModel(data As GridModel) As ElementShape
- Dim shape As ElementShape = Nothing
- Select Case data.Shape
- Case "RoundRect"
- shape = New RoundRectShape()
- Exit Select
- Case "Diamond"
- shape = New DiamondShape()
- Exit Select
- Case "Star"
- shape = New StarShape()
- Exit Select
- Case "Heart"
- shape = New HeartShape()
- Exit Select
- Case "Media"
- shape = New MediaShape()
- Exit Select
- Case "Donut"
- shape = New DonutShape()
- Exit Select
- Case Else
- shape = New CustomShape()
- Exit Select
- End Select
- Return shape
-End Function
-
-'endregion
-Class
-gion HelperClasses
-ic Class GridModel
-Public Property Id() As Integer
- Get
- Return m_Id
- End Get
- Set(value As Integer)
- m_Id = value
- End Set
-End Property
-Private m_Id As Integer
-Public Property Color() As Color
- Get
- Return m_Color
- End Get
- Set(value As Color)
- m_Color = value
- End Set
-End Property
-Private m_Color As Color
-Public Property Shape() As String
- Get
- Return m_Shape
- End Get
- Set(value As String)
- m_Shape = value
- End Set
-End Property
-Private m_Shape As String
-Class
-ic Class CustomRowGridBehavior
-Inherits GridDataRowBehavior
-Protected Overrides Function OnMouseDownLeft(e As MouseEventArgs) As Boolean
- Dim row As GridDataRowElement = TryCast(Me.GetRowAtPoint(e.Location), GridDataRowElement)
- If row IsNot Nothing Then
- Dim svc As RadGridViewDragDropService = Me.GridViewElement.GetService(Of RadGridViewDragDropService)()
- svc.Start(row)
- End If
- Return MyBase.OnMouseDownLeft(e)
-End Function
-Class
-
-````
-
+
+
-{{endregion}}
# See Also
diff --git a/controls/diagram/drag-and-drop/ole-drag-and-drop.md b/controls/diagram/drag-and-drop/ole-drag-and-drop.md
index 4ee4fb3ab..494f76af0 100644
--- a/controls/diagram/drag-and-drop/ole-drag-and-drop.md
+++ b/controls/diagram/drag-and-drop/ole-drag-and-drop.md
@@ -20,39 +20,10 @@ In order to achieve the desired result the MouseDown, MouseMove and MouseUp even
#### Subscribe to Events
-{{source=..\SamplesCS\Diagram\OleDragAndDropForm.cs region=SubscribeEvents}}
-{{source=..\SamplesVB\Diagram\OleDragAndDropForm.vb region=SubscribeEvents}}
-````C#
-public OleDragAndDropForm()
-{
- InitializeComponent();
- this.radDiagram2.AllowDrop = true;
- this.radDiagram1.IsDraggingEnabled = false;
- this.radDiagram1.MouseMove += radDiagram1_MouseMove;
- this.radDiagram1.MouseDown += radDiagram1_MouseDown;
- this.radDiagram1.MouseUp += radDiagram1_MouseUp;
- this.radDiagram2.DragEnter += radDiagram2_DragEnter;
- this.radDiagram2.DragDrop += radDiagram2_DragDrop;
-}
-
-````
-````VB.NET
-Public Sub New()
- InitializeComponent()
- Me.RadDiagram2.AllowDrop = True
- Me.RadDiagram1.IsDraggingEnabled = False
- AddHandler Me.RadDiagram1.MouseMove, AddressOf radDiagram1_MouseMove
- AddHandler Me.RadDiagram1.MouseDown, AddressOf radDiagram1_MouseDown
- AddHandler Me.RadDiagram1.MouseUp, AddressOf radDiagram1_MouseUp
- AddHandler Me.RadDiagram2.DragEnter, AddressOf radDiagram2_DragEnter
- AddHandler Me.RadDiagram2.DragDrop, AddressOf radDiagram2_DragDrop
-End Sub
-
-````
-
-
-
-{{endregion}}
+
+
+
+
For the purpose of the example we will define a grid model object storing information about the shapes.
@@ -62,98 +33,10 @@ __RadDiagram__ will accept the dragged data only if it is dropped on the diagram
#### Drag and Drop Events
-{{source=..\SamplesCS\Diagram\OleDragAndDropForm.cs region=HandleEvents}}
-{{source=..\SamplesVB\Diagram\OleDragAndDropForm.vb region=HandleEvents}}
-````C#
-private void radDiagram2_DragDrop(object sender, DragEventArgs e)
-{
- Telerik.WinControls.UI.RadDiagram diagram = sender as Telerik.WinControls.UI.RadDiagram;
- Point point = diagram.PointToClient(new Point(e.X, e.Y));
- RadDiagramShape draggedItem = e.Data.GetData(typeof(RadDiagramShape)) as RadDiagramShape;
- this.radDiagram1.RemoveShape(draggedItem);
- draggedItem.Position = point;
- diagram.AddShape(draggedItem);
- this.mouseDownPosition = Point.Empty;
-}
-private void radDiagram2_DragEnter(object sender, DragEventArgs e)
-{
- e.Effect = DragDropEffects.Copy;
-}
-private Point mouseDownPosition;
-private void radDiagram1_MouseDown(object sender, MouseEventArgs e)
-{
- this.mouseDownPosition = e.Location;
-}
-private void radDiagram1_MouseUp(object sender, MouseEventArgs e)
-{
- this.mouseDownPosition = Point.Empty;
-}
-private void radDiagram1_MouseMove(object sender, MouseEventArgs e)
-{
- if (!(e.Button == MouseButtons.Left))
- {
- return;
- }
- if (this.ShouldBeginDrag(this.mouseDownPosition, e.Location))
- {
- RadDiagramShape draggedItem = this.radDiagram1.ElementTree.GetElementAtPoint(this.mouseDownPosition).Parent as RadDiagramShape;
- if (draggedItem != null)
- {
- ((Telerik.WinControls.UI.RadDiagram)sender).DoDragDrop(draggedItem, DragDropEffects.Copy);
- }
- }
-}
-private bool ShouldBeginDrag(Point current, Point capture)
-{
- Size dragSize = SystemInformation.DragSize;
- Rectangle dragRect = new Rectangle(capture.X - dragSize.Width / 2,
- capture.Y - dragSize.Height / 2, dragSize.Width, dragSize.Height);
- return !dragRect.Contains(current);
-}
-
-````
-````VB.NET
-Private Sub radDiagram2_DragDrop(sender As Object, e As DragEventArgs)
- Dim diagram As Telerik.WinControls.UI.RadDiagram = TryCast(sender, Telerik.WinControls.UI.RadDiagram)
- Dim point As Point = diagram.PointToClient(New Point(e.X, e.Y))
- Dim draggedItem As RadDiagramShape = TryCast(e.Data.GetData(GetType(RadDiagramShape)), RadDiagramShape)
- Me.RadDiagram1.RemoveShape(draggedItem)
- draggedItem.Position = point
- diagram.AddShape(draggedItem)
- Me.mouseDownPosition = point.Empty
-End Sub
-Private Sub radDiagram2_DragEnter(sender As Object, e As DragEventArgs)
- e.Effect = DragDropEffects.Copy
-End Sub
-Private mouseDownPosition As Point
-Private Sub radDiagram1_MouseDown(sender As Object, e As MouseEventArgs)
- Me.mouseDownPosition = e.Location
-End Sub
-Private Sub radDiagram1_MouseUp(sender As Object, e As MouseEventArgs)
- Me.mouseDownPosition = Point.Empty
-End Sub
-Private Sub radDiagram1_MouseMove(sender As Object, e As MouseEventArgs)
- If Not (e.Button = MouseButtons.Left) Then
- Return
- End If
- If Me.ShouldBeginDrag(Me.mouseDownPosition, e.Location) Then
- Dim draggedItem As RadDiagramShape = TryCast(Me.RadDiagram1.ElementTree.GetElementAtPoint(Me.mouseDownPosition).Parent, RadDiagramShape)
- If draggedItem IsNot Nothing Then
- DirectCast(sender, Telerik.WinControls.UI.RadDiagram).DoDragDrop(draggedItem, DragDropEffects.Copy)
- End If
- End If
-End Sub
-Private Function ShouldBeginDrag(current As Point, capture As Point) As Boolean
- Dim dragSize As Size = SystemInformation.DragSize
- Dim dragRect As New Rectangle(capture.X - dragSize.Width / 2, capture.Y - dragSize.Height / 2, dragSize.Width, dragSize.Height)
- Return Not dragRect.Contains(current)
-End Function
-
-````
-
-
-
-{{endregion}}
+
+
+
+
# See Also
diff --git a/controls/diagram/features/commands.md b/controls/diagram/features/commands.md
index d8c90488e..3101217ef 100644
--- a/controls/diagram/features/commands.md
+++ b/controls/diagram/features/commands.md
@@ -104,40 +104,10 @@ The static __DiagramCommands__ class defines the following __RoutedUICommands__:
Below is shown a sample code snippet how you can use some of the Diagram Commands in an application by using the DiagramElement.__TryExecuteCommand__ method:
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=CommandsExample}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=CommandsExample}}
-
-````C#
-
-private void radButton1_Click(object sender, EventArgs e)
-{
- this.radDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Copy);
-}
-
-private void radButton2_Click(object sender, EventArgs e)
-{
- this.radDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Paste);
-}
-private void radButton3_Click(object sender, EventArgs e)
-{
- this.radDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Nudge, "Left");
-}
-
-````
-````VB.NET
-Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
- Me.RadDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Copy)
-End Sub
-Private Sub RadButton2_Click(sender As Object, e As EventArgs) Handles RadButton2.Click
- Me.RadDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Paste)
-End Sub
-Private Sub RadButton3_Click(sender As Object, e As EventArgs) Handles RadButton3.Click
- Me.RadDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Nudge, "Left")
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+

diff --git a/controls/diagram/features/export.md b/controls/diagram/features/export.md
index 82e96d87c..04dca4191 100644
--- a/controls/diagram/features/export.md
+++ b/controls/diagram/features/export.md
@@ -19,23 +19,10 @@ The __RadDiagram__ framework provides a method for exporting its current state t
The RadDiagram.__ExportToImage()__ method allows you to export the diagram to an image. It returns an Image which can be saved in the desired type.
-{{source=..\SamplesCS\Diagram\DiagramItems.cs region=Export}}
-{{source=..\SamplesVB\Diagram\DiagramItems.vb region=Export}}
+
+
-````C#
-Image img1 = this.radDiagram1.ExportToImage();
-string imagePath1 = @"..\..\img1.png";
-img1.Save(imagePath1);
-````
-````VB.NET
-Dim img1 As Image = Me.RadDiagram1.ExportToImage()
-Dim imagePath1 As String = "..\..\img1.png"
-img1.Save(imagePath1)
-
-````
-
-{{endregion}}
Alternatively, you can use the __RadDiagramRibbonBar__ and its *Export* button:
diff --git a/controls/diagram/features/grouping.md b/controls/diagram/features/grouping.md
index bb26c98b5..388c61595 100644
--- a/controls/diagram/features/grouping.md
+++ b/controls/diagram/features/grouping.md
@@ -74,63 +74,18 @@ In the next example we will create 20 shapes with contents - "1", "2",... "20" a
Let's first create some random shapes:
-{{source=..\SamplesCS\Diagram\DiagramGrouping.cs region=AddShapes}}
-{{source=..\SamplesVB\Diagram\DiagramGrouping.vb region=AddShapes}}
+
+
-````C#
-
-Random random = new Random();
-for (int i = 0; i < 21; i++)
-{
- RadDiagramShape s = new RadDiagramShape() { Width = 30, Height = 30, Content = i };
- s.Shape = new Telerik.WinControls.RoundRectShape(5);
- s.BackColor = System.Drawing.Color.CadetBlue;
- s.Position = new Telerik.Windows.Diagrams.Core.Point(random.Next(0, 900), random.Next(0, 200));
- this.radDiagram1.Items.Add(s);
-}
-
-````
-````VB.NET
-Dim random As New Random()
-For i As Integer = 0 To 20
- Dim s As New RadDiagramShape() With { _
- .Width = 30, _
- .Height = 30, _
- .Content = i _
- }
- s.Shape = New Telerik.WinControls.RoundRectShape(5)
- s.BackColor = Color.CadetBlue
- s.Position = New Telerik.Windows.Diagrams.Core.Point(random.[Next](0, 900), random.[Next](0, 200))
- Me.RadDiagram1.Items.Add(s)
-Next
-
-````
-
-{{endregion}}
+
Now let's implement some grouping logic:
-{{source=..\SamplesCS\Diagram\DiagramGrouping.cs region=Group}}
-{{source=..\SamplesVB\Diagram\DiagramGrouping.vb region=Group}}
-
-````C#
-
-IShape[] evenShapes = this.radDiagram1.Shapes.Where(x => int.Parse(x.Content.ToString()) % 2 == 0).ToArray();
-IShape[] oddShapes = this.radDiagram1.Shapes.Where(x => int.Parse(x.Content.ToString()) % 2 == 1).ToArray();
-this.radDiagram1.Group("Even", evenShapes);
-this.radDiagram1.Group("Odd", oddShapes);
-
-````
-````VB.NET
-Dim evenShapes As IShape() = Me.RadDiagram1.Shapes.Where(Function(x) Integer.Parse(x.Content.ToString()) Mod 2 = 0).ToArray()
-Dim oddShapes As IShape() = Me.RadDiagram1.Shapes.Where(Function(x) Integer.Parse(x.Content.ToString()) Mod 2 = 1).ToArray()
-Me.RadDiagram1.Group("Even", evenShapes)
-Me.RadDiagram1.Group("Odd", oddShapes)
+
+
-````
-
-{{endregion}}
+
@@ -146,23 +101,10 @@ Below you can see how the grouping works:
Now let's play with grouping and upgrouping. Below are some code examples and the result of the code execution:
-{{source=..\SamplesCS\Diagram\DiagramGrouping.cs region=NewGroups}}
-{{source=..\SamplesVB\Diagram\DiagramGrouping.vb region=NewGroups}}
+
+
-````C#
-
-this.radDiagram1.Group("123", this.radDiagram1.Shapes[1], this.radDiagram1.Shapes[2], this.radDiagram1.Shapes[3]);
-this.radDiagram1.Group("345", this.radDiagram1.Shapes[3], this.radDiagram1.Shapes[4], this.radDiagram1.Shapes[5]);
-
-````
-````VB.NET
-
-Me.RadDiagram1.Group("123", Me.RadDiagram1.Shapes(1), Me.RadDiagram1.Shapes(2), Me.RadDiagram1.Shapes(3))
-Me.RadDiagram1.Group("345", Me.RadDiagram1.Shapes(3), Me.RadDiagram1.Shapes(4), Me.RadDiagram1.Shapes(5))
-
-````
-
-{{endregion}}
+
This makes group "123" with items {Shapes[1],Shapes[2]} and "345" with items {Shapes[3], Shapes[4], Shapes[5]}. The creation of the second group excludes Shapes[3] from group "123".
@@ -170,22 +112,10 @@ This makes group "123" with items {Shapes[1],Shapes[2]} and "345" with items {Sh
Alternatively if we use one name in the method:
-{{source=..\SamplesCS\Diagram\DiagramGrouping.cs region=ReplaceGroup}}
-{{source=..\SamplesVB\Diagram\DiagramGrouping.vb region=ReplaceGroup}}
-
-````C#
-
-this.radDiagram1.Group("123", this.radDiagram1.Shapes[1], this.radDiagram1.Shapes[2], this.radDiagram1.Shapes[3]);
-this.radDiagram1.Group("123", this.radDiagram1.Shapes[3], this.radDiagram1.Shapes[4], this.radDiagram1.Shapes[5]);
+
+
-````
-````VB.NET
-Me.RadDiagram1.Group("123", Me.RadDiagram1.Shapes(1), Me.RadDiagram1.Shapes(2), Me.RadDiagram1.Shapes(3))
-Me.RadDiagram1.Group("123", Me.RadDiagram1.Shapes(3), Me.RadDiagram1.Shapes(4), Me.RadDiagram1.Shapes(5))
-
-````
-
-{{endregion}}
+
This produces a single group "123" with the 5 elements Shapes[1]-Shapes[5].
@@ -196,25 +126,10 @@ Subgrouping must be done from subgroups to parent groups. In other words, creati
Below is an example of creating a subgroups and a parent group.
-{{source=..\SamplesCS\Diagram\DiagramGrouping.cs region=Subgroups}}
-{{source=..\SamplesVB\Diagram\DiagramGrouping.vb region=Subgroups}}
-
-````C#
-
-IGroup groupA = this.radDiagram1.Group("1-2", this.radDiagram1.Shapes[1], this.radDiagram1.Shapes[2]);
-IGroup groupB = this.radDiagram1.Group("3-4", this.radDiagram1.Shapes[3], this.radDiagram1.Shapes[4]);
-IGroup parentGroup = this.radDiagram1.Group("1-2-3-4", groupA, groupB);
-
-````
-````VB.NET
-
-Dim groupA As IGroup = Me.RadDiagram1.Group("1-2", Me.RadDiagram1.Shapes(1), Me.RadDiagram1.Shapes(2))
-Dim groupB As IGroup = Me.RadDiagram1.Group("3-4", Me.RadDiagram1.Shapes(3), Me.RadDiagram1.Shapes(4))
-Dim parentGroup As IGroup = Me.RadDiagram1.Group("1-2-3-4", groupA, groupB)
+
+
-````
-
-{{endregion}}
+
@@ -231,22 +146,10 @@ Below you can see how consecutive clicks on a shape reflects the selection of gr
What will happen if we try to create parent group then create subgroups?
-{{source=..\SamplesCS\Diagram\DiagramGrouping.cs region=ParentToSubgroups}}
-{{source=..\SamplesVB\Diagram\DiagramGrouping.vb region=ParentToSubgroups}}
+
+
-````C#
-
-this.radDiagram1.Group("1-2-3-4", this.radDiagram1.Shapes[1], this.radDiagram1.Shapes[2], this.radDiagram1.Shapes[3], this.radDiagram1.Shapes[4]);
-this.radDiagram1.Group("1-2", this.radDiagram1.Shapes[1], this.radDiagram1.Shapes[2]);
-
-````
-````VB.NET
-Me.RadDiagram1.Group("1-2-3-4", Me.RadDiagram1.Shapes(1), Me.RadDiagram1.Shapes(2), Me.RadDiagram1.Shapes(3), Me.RadDiagram1.Shapes(4))
-Me.RadDiagram1.Group("1-2", Me.RadDiagram1.Shapes(1), Me.RadDiagram1.Shapes(2))
-
-````
-
-{{endregion}}
+
This will create two separate groups - "1-2-3-4" with items {Shapes[3], Shapes[4]} and "1-2" with items {Shapes[1], Shapes[2]}.
@@ -258,45 +161,20 @@ __Ungrouping__
You can Ungroup one or several groups with the __Ungroup__ method of __RadDiagram__:
-{{source=..\SamplesCS\Diagram\DiagramGrouping.cs region=Ungroup}}
-{{source=..\SamplesVB\Diagram\DiagramGrouping.vb region=Ungroup}}
+
+
-````C#
-
-this.radDiagram1.Ungroup(groupA, groupB);
-this.radDiagram1.Ungroup(this.radDiagram1.Groups.ToArray());
-
-````
-````VB.NET
-Me.RadDiagram1.Ungroup(groupA, groupB)
-Me.RadDiagram1.Ungroup(Me.RadDiagram1.Groups.ToArray())
-
-````
-
-{{endregion}}
+
## Grouping With Commands
Using the DiagramCommands __Group__ and __Ungroup__ is straightforward. __Group__ applies to the selected __IGroupables__ and __Ungroup__ applies to the selected __IGroups__.
-{{source=..\SamplesCS\Diagram\DiagramGrouping.cs region=CommandsGrouping}}
-{{source=..\SamplesVB\Diagram\DiagramGrouping.vb region=CommandsGrouping}}
+
+
-````C#
-this.radDiagram1.DiagramElement.ServiceLocator.GetService>().SelectItem(this.radDiagram1.Shapes[1],true);
-this.radDiagram1.DiagramElement.ServiceLocator.GetService>().SelectItem(this.radDiagram1.Shapes[5],true);
-this.radDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Group);
-
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.ServiceLocator.GetService(Of ISelectionService(Of IDiagramItem))().SelectItem(Me.RadDiagram1.Shapes(1), True)
-Me.RadDiagram1.DiagramElement.ServiceLocator.GetService(Of ISelectionService(Of IDiagramItem))().SelectItem(Me.RadDiagram1.Shapes(5), True)
-Me.RadDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Group)
-
-````
-
-{{endregion}}
+
diff --git a/controls/diagram/features/layout.md b/controls/diagram/features/layout.md
index 71a4cfe1d..84d5e9dbd 100644
--- a/controls/diagram/features/layout.md
+++ b/controls/diagram/features/layout.md
@@ -21,67 +21,25 @@ Sugiyama is the default layout algorithm in __RadDiagram__. Using it is straight
* use the RadDiagram.__SetLayout__ method:
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=SetLayout}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=SetLayout}}
+
+
-````C#
-this.radDiagram1.SetLayout(Telerik.Windows.Diagrams.Core.LayoutType.Sugiyama);
-
-````
-````VB.NET
-Me.RadDiagram1.SetLayout(Telerik.Windows.Diagrams.Core.LayoutType.Sugiyama)
-
-````
-
-{{endregion}}
+
* use the DiagramCommands.__Layout__:
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=LayoutCommand}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=LayoutCommand}}
-
-````C#
-this.radDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Layout);
-
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Layout)
-
-````
+
+
-{{endregion}}
+
The __SetLayout__ method provides two optional parameters - the type of the Layout (Sugiyama or Tree) and the corresponding layout settings (SugiyamaSettings or TreeLayoutSettings):
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=SugiyamaSettings}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=SugiyamaSettings}}
-
-````C#
-Telerik.Windows.Diagrams.Core.SugiyamaSettings settings = new Telerik.Windows.Diagrams.Core.SugiyamaSettings()
-{
- HorizontalDistance = 50,
- VerticalDistance = 20,
- Orientation = Telerik.Windows.Diagrams.Core.Orientation.Horizontal,
- TotalMargin = new Telerik.Windows.Diagrams.Core.Size(20, 20),
- ShapeMargin = new Telerik.Windows.Diagrams.Core.Size(10, 10),
-};
-this.radDiagram1.SetLayout(Telerik.Windows.Diagrams.Core.LayoutType.Sugiyama, settings);
-
-````
-````VB.NET
-Dim settings As New Telerik.Windows.Diagrams.Core.SugiyamaSettings() With { _
- .HorizontalDistance = 50, _
- .VerticalDistance = 20, _
- .Orientation = Telerik.Windows.Diagrams.Core.Orientation.Horizontal, _
- .TotalMargin = New Telerik.Windows.Diagrams.Core.Size(20, 20), _
- .ShapeMargin = New Telerik.Windows.Diagrams.Core.Size(10, 10) _
-}
-Me.RadDiagram1.SetLayout(Telerik.Windows.Diagrams.Core.LayoutType.Sugiyama, Settings)
-
-````
+
+
-{{endregion}}
+
@@ -158,31 +116,10 @@ Below you can see a snapshots of random diagrams laid out with Tree Layout types
Here is how this could be achieved in code behind.
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=TreeLayoutSettings}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=TreeLayoutSettings}}
+
+
-````C#
-
-Telerik.Windows.Diagrams.Core.TreeLayoutSettings settings = new Telerik.Windows.Diagrams.Core.TreeLayoutSettings()
-{
- TreeLayoutType = Telerik.Windows.Diagrams.Core.TreeLayoutType.RadialTree,
- VerticalDistance = 20,
-};
-settings.Roots.Add(this.radDiagram1.Shapes[0]);
-this.radDiagram1.SetLayout(Telerik.Windows.Diagrams.Core.LayoutType.Tree, settings);
-
-````
-````VB.NET
-Dim settings As New Telerik.Windows.Diagrams.Core.TreeLayoutSettings() With { _
- .TreeLayoutType = Telerik.Windows.Diagrams.Core.TreeLayoutType.RadialTree, _
- .VerticalDistance = 20 _
-}
-Settings.Roots.Add(Me.RadDiagram1.Shapes(0))
-Me.RadDiagram1.SetLayout(Telerik.Windows.Diagrams.Core.LayoutType.Tree, Settings)
-
-````
-
-{{endregion}}
+
## Layout Settings
diff --git a/controls/diagram/features/pan-and-zoom.md b/controls/diagram/features/pan-and-zoom.md
index 498c7300e..921ad942f 100644
--- a/controls/diagram/features/pan-and-zoom.md
+++ b/controls/diagram/features/pan-and-zoom.md
@@ -21,21 +21,10 @@ __RadDiagram__ exposes an __IsPanEnabled__ property which defines whether the pa
You can also activate the Pan [MouseTool]({%slug winforms/diagram-(beta)/diagram-tools/mouse-tools%}) to start a pan operation simply by dragging the current view port with the mouse.
-{{source=..\SamplesCS\Diagram\DiagramPanZoom.cs region=IsPanEnabled}}
-{{source=..\SamplesVB\Diagram\DiagramPanZoom.vb region=IsPanEnabled}}
-````C#
-
-this.radDiagram1.IsPanEnabled = true;
-
-````
-````VB.NET
-Me.RadDiagram1.IsPanEnabled = True
-
-````
-
-
+
+
-{{endregion}}
+
@@ -47,20 +36,10 @@ Me.RadDiagram1.IsPanEnabled = True
## Pan Methods
You can use the __PanToPosition__ method in order to programmatically pan to a specific position:
-{{source=..\SamplesCS\Diagram\DiagramPanZoom.cs region=PanMethod}}
-{{source=..\SamplesVB\Diagram\DiagramPanZoom.vb region=PanMethod}}
-````C#
-this.radDiagram1.PanToPosition(new Telerik.Windows.Diagrams.Core.Point(200, 300));
-
-````
-````VB.NET
-Me.RadDiagram1.PanToPosition(New Point(200, 300))
-
-````
-
+
+
-
-{{endregion}}
+
## Pan events
@@ -89,20 +68,10 @@ __RadDiagram__ exposes two panning events:
__RadDiagram__ supports zooming out-of-the-box. The feature is controlled through the RadDiagram. __IsZoomEnabled__ property which default value is *true*. The user can initiate a zoom using the mouse wheel.
-{{source=..\SamplesCS\Diagram\DiagramPanZoom.cs region=IsZoomEnabled}}
-{{source=..\SamplesVB\Diagram\DiagramPanZoom.vb region=IsZoomEnabled}}
-````C#
-this.radDiagram1.IsZoomEnabled = true;
-
-````
-````VB.NET
-Me.RadDiagram1.IsZoomEnabled = True
-
-````
+
+
-
-
-{{endregion}}
+
@@ -117,22 +86,10 @@ The zoom range is controlled through two __DiagramConstants__:
* __MaximumZoom__: a double value which indicates the maximum zoom level. Its default value is 5.
-{{source=..\SamplesCS\Diagram\DiagramPanZoom.cs region=MinMaxZoom}}
-{{source=..\SamplesVB\Diagram\DiagramPanZoom.vb region=MinMaxZoom}}
-````C#
-
-Telerik.Windows.Diagrams.Core.DiagramConstants.MinimumZoom = 0.5;
-Telerik.Windows.Diagrams.Core.DiagramConstants.MaximumZoom = 10;
+
+
-````
-````VB.NET
-Telerik.Windows.Diagrams.Core.DiagramConstants.MinimumZoom = 0.5
-Telerik.Windows.Diagrams.Core.DiagramConstants.MaximumZoom = 10
-
-````
-
-
-{{endregion}}
+
The current zoom value in a __RadDiagram__ instance is controlled through the __Zoom__ property. It represents a double value which cannot be null, infinity or NaN. Additionally, this value is coerced to be within the range defined by the __MinimumZoom__ and __MaximumZoom__ constants. The default __Zoom__ value is 1.
@@ -156,20 +113,10 @@ If you need to initiate a zoom through code-behind, __RadDiagram__ provides two
>note Please note that both of the parameters described above are optional.
>
-{{source=..\SamplesCS\Diagram\DiagramPanZoom.cs region=ZoomIn}}
-{{source=..\SamplesVB\Diagram\DiagramPanZoom.vb region=ZoomIn}}
-
-````C#
-
-this.radDiagram1.DiagramElement.ZoomIn(1.5);
-
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.ZoomIn(1.5)
-
-````
+
+
-{{endregion}}
+
* __ZoomOut__: this method performs an incremental zoom out taking into account the previous zoom operations. It can take up to 2 parameters:
@@ -181,44 +128,16 @@ Me.RadDiagram1.DiagramElement.ZoomIn(1.5)
>note Please note that both of the parameters described above are optional.
>
-{{source=..\SamplesCS\Diagram\DiagramPanZoom.cs region=ZoomOut}}
-{{source=..\SamplesVB\Diagram\DiagramPanZoom.vb region=ZoomOut}}
-
-````C#
-
-this.radDiagram1.DiagramElement.ZoomOut(3.5);
-
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.ZoomOut(3.5)
+
+
-````
-
-{{endregion}}
+
* __BringIntoView__: This method allows you to center the currently occupied space:
-{{source=..\SamplesCS\Diagram\DiagramPanZoom.cs region=BringIntoView}}
-{{source=..\SamplesVB\Diagram\DiagramPanZoom.vb region=BringIntoView}}
-````C#
-private void radButton1_Click(object sender, EventArgs e)
-{
- var enclosingBounds = ((IGraph)this.radDiagram1.DiagramElement).CalculateEnclosingBoundsWithoutTransform();
- this.radDiagram1.DiagramElement.BringIntoView(enclosingBounds, false);
- this.radDiagram1.Zoom = 1;
-}
-
-````
-````VB.NET
-Private Sub radButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
- Dim enclosingBounds = DirectCast(Me.RadDiagram1.DiagramElement, IGraph).CalculateEnclosingBoundsWithoutTransform()
- Me.RadDiagram1.DiagramElement.BringIntoView(enclosingBounds, False)
- Me.RadDiagram1.Zoom = 1
-End Sub
-
-````
-
-
-{{endregion}}
+
+
+
+
## Zoom events
diff --git a/controls/diagram/features/printing-support.md b/controls/diagram/features/printing-support.md
index dbea50661..0df005164 100644
--- a/controls/diagram/features/printing-support.md
+++ b/controls/diagram/features/printing-support.md
@@ -18,38 +18,18 @@ __RadDiagram__ provides options to print its content by using a [RadPrintDocumen
__RadDiagram__ has two public methods available for printing - __Print()__ and __PrintPreview()__. The first method will directly send a print job to the default printer with the settings currently saved in the __PrintStyle__ property. This method has one overload available which can show a system PrintDialog with the available printers and their options.
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=Print}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=Print}}
+
+
-````C#
-this.radDiagram1.Print();
-this.radDiagram1.Print(true);
-
-````
-````VB.NET
-Me.RadDiagram1.Print()
-Me.RadDiagram1.Print(True)
-
-````
-
-{{endregion}}
+
The other available method is __PrintPreview()__, which opens [RadPrintPreviewDialog]({%slug winforms/telerik-presentation-framework/printing-support/end-user-functionality/print-preview-dialog%}).
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=PrintPreview}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=PrintPreview}}
-
-````C#
-this.radDiagram1.PrintPreview();
+
+
-````
-````VB.NET
-Me.RadDiagram1.PrintPreview()
-
-````
-
-{{endregion}}
+
diff --git a/controls/diagram/features/routing.md b/controls/diagram/features/routing.md
index 509c523c0..db0ee780b 100644
--- a/controls/diagram/features/routing.md
+++ b/controls/diagram/features/routing.md
@@ -38,29 +38,10 @@ The __OrgTreeRouter__ is a __LayoutType__ - based router that performs a hierarc
In order to use the __OrgTreeRouter__, you have to instantiate an __OrgTreeRouter__ object and set it as current __Router__ of the __RadDiagram__ via the __RoutingService__:
-{{source=..\SamplesCS\Diagram\DiagramRouting.cs region=OrgTreeRouter}}
-{{source=..\SamplesVB\Diagram\DiagramRouting.vb region=OrgTreeRouter}}
+
+
-````C#
-
-Telerik.Windows.Diagrams.Core.OrgTreeRouter router = new Telerik.Windows.Diagrams.Core.OrgTreeRouter()
-{
- TreeLayoutType = Telerik.Windows.Diagrams.Core.TreeLayoutType.TreeDown,
- ConnectionOuterSpacing = 20,
-};
-this.radDiagram1.RoutingService.Router = router;
-
-````
-````VB.NET
-Dim router As New Telerik.Windows.Diagrams.Core.OrgTreeRouter() With { _
- .TreeLayoutType = Telerik.Windows.Diagrams.Core.TreeLayoutType.TreeDown, _
- .ConnectionOuterSpacing = 20 _
-}
-Me.RadDiagram1.RoutingService.Router = router
-
-````
-
-{{endregion}}
+
@@ -79,48 +60,10 @@ When the __TreeLayoutType__ is set to *TipOverTree*, the __OrgTreeRouter__ uses
Here is a sample code snippet demonstrating how to create and configure __TreeLayoutSettings__ and create and assign a __Router__ to be the default one.
-{{source=..\SamplesCS\Diagram\DiagramRouting.cs region=TipOverTreeRouter}}
-{{source=..\SamplesVB\Diagram\DiagramRouting.vb region=TipOverTreeRouter}}
-
-````C#
-
-Telerik.Windows.Diagrams.Core.TreeLayoutSettings settings = new Telerik.Windows.Diagrams.Core.TreeLayoutSettings()
-{
- TreeLayoutType = Telerik.Windows.Diagrams.Core.TreeLayoutType.TipOverTree,
- UnderneathVerticalSeparation = 50,
- VerticalDistance = 50,
- UnderneathHorizontalOffset = 50,
- UnderneathVerticalTopOffset = 50
-};
-settings.Roots.Add(this.radDiagram1.Shapes[0]);
-Telerik.Windows.Diagrams.Core.OrgTreeRouter router = new Telerik.Windows.Diagrams.Core.OrgTreeRouter()
-{
- TreeLayoutType = Telerik.Windows.Diagrams.Core.TreeLayoutType.TipOverTree,
- ConnectionOuterSpacing = 10
-};
-this.radDiagram1.RoutingService.Router = router;
-this.radDiagram1.SetLayout(Telerik.Windows.Diagrams.Core.LayoutType.Tree, settings);
-
-````
-````VB.NET
-Dim settings As New Telerik.Windows.Diagrams.Core.TreeLayoutSettings() With { _
- .TreeLayoutType = Telerik.Windows.Diagrams.Core.TreeLayoutType.TipOverTree, _
- .UnderneathVerticalSeparation = 50, _
- .VerticalDistance = 50, _
- .UnderneathHorizontalOffset = 50, _
- .UnderneathVerticalTopOffset = 50 _
-}
-settings.Roots.Add(Me.RadDiagram1.Shapes(0))
-Dim router As New Telerik.Windows.Diagrams.Core.OrgTreeRouter() With { _
- .TreeLayoutType = Telerik.Windows.Diagrams.Core.TreeLayoutType.TipOverTree, _
- .ConnectionOuterSpacing = 10 _
-}
-Me.RadDiagram1.RoutingService.Router = router
-Me.RadDiagram1.SetLayout(Telerik.Windows.Diagrams.Core.LayoutType.Tree, settings)
-
-````
-
-{{endregion}}
+
+
+
+
@@ -200,127 +143,27 @@ In the following section we will create a custom Router. This way we will be abl
Let's first create some items:
-{{source=..\SamplesCS\Diagram\DiagramRouting.cs region=PopulateItems}}
-{{source=..\SamplesVB\Diagram\DiagramRouting.vb region=PopulateItems}}
-
-````C#
-
-RadDiagramShape shapeA = new RadDiagramShape()
-{
- Text = "ShapeA",
- ElementShape = new RoundRectShape(4),
- BackColor = Color.CadetBlue
-};
-shapeA.Position = new Telerik.Windows.Diagrams.Core.Point(100, 100);
-this.radDiagram1.Items.Add(shapeA);
-
-RadDiagramShape shapeB = new RadDiagramShape()
-{
- Text = "ShapeB",
- ElementShape = new RoundRectShape(4),
- BackColor = Color.CadetBlue
-};
-shapeB.Position = new Telerik.Windows.Diagrams.Core.Point(300, 100);
-this.radDiagram1.Items.Add(shapeB);
-
-RadDiagramConnection connection = new RadDiagramConnection()
-{
- Source = shapeA,
- Target = shapeB
-};
-this.radDiagram1.Items.Add(connection);
-
-````
-````VB.NET
-Dim shapeA As New RadDiagramShape() With { _
- .Text = "ShapeA", _
- .ElementShape = New RoundRectShape(4), _
- .BackColor = Color.CadetBlue _
-}
-shapeA.Position = New Telerik.Windows.Diagrams.Core.Point(100, 100)
-Me.RadDiagram1.Items.Add(shapeA)
-Dim shapeB As New RadDiagramShape() With { _
- .Text = "ShapeB", _
- .ElementShape = New RoundRectShape(4), _
- .BackColor = Color.CadetBlue _
-}
-shapeB.Position = New Telerik.Windows.Diagrams.Core.Point(300, 100)
-Me.RadDiagram1.Items.Add(shapeB)
-Dim connection As New RadDiagramConnection() With { _
- .Source = shapeA, _
- .Target = shapeB _
-}
-Me.RadDiagram1.Items.Add(connection)
-
-````
-
-{{endregion}}
+
+
+
+
Now we have to create class that implements the __IRouter__ interface and override the GetRoutePoints() method:
-{{source=..\SamplesCS\Diagram\DiagramRouting.cs region=CustomRouter}}
-{{source=..\SamplesVB\Diagram\DiagramRouting.vb region=CustomRouter}}
+
+
-````C#
-
-public class CustomRouter : Telerik.Windows.Diagrams.Core.IRouter
-{
- public System.Collections.Generic.IList GetRoutePoints(Telerik.Windows.Diagrams.Core.IConnection connection, bool showLastLine)
- {
- List pointList = new List();
- Telerik.Windows.Diagrams.Core.Point start = connection.StartPoint;
- Telerik.Windows.Diagrams.Core.Point end = connection.EndPoint;
-
- pointList.Add(new Telerik.Windows.Diagrams.Core.Point(start.X + (end.X - start.X) * 0.45, start.Y));
- pointList.Add(new Telerik.Windows.Diagrams.Core.Point((start.X + end.X) / 2, (start.Y + end.Y) / 2 - 50));
- pointList.Add(new Telerik.Windows.Diagrams.Core.Point((start.X + end.X) / 2, (start.Y + end.Y) / 2 + 50));
- pointList.Add(new Telerik.Windows.Diagrams.Core.Point(start.X + (end.X - start.X) * 0.55, end.Y));
-
- return pointList;
- }
-}
-
-````
-````VB.NET
-Public Class CustomRouter
-Implements Telerik.Windows.Diagrams.Core.IRouter
- Public Function GetRoutePoints1(connection As Telerik.Windows.Diagrams.Core.IConnection, showLastLine As Boolean) As IList(Of Telerik.Windows.Diagrams.Core.Point) Implements Telerik.Windows.Diagrams.Core.IRouter.GetRoutePoints
- Dim pointList As New List(Of Telerik.Windows.Diagrams.Core.Point)()
- Dim start As Telerik.Windows.Diagrams.Core.Point = connection.StartPoint
- Dim [end] As Telerik.Windows.Diagrams.Core.Point = connection.EndPoint
- pointList.Add(New Telerik.Windows.Diagrams.Core.Point(start.X + ([end].X - start.X) * 0.45, start.Y))
- pointList.Add(New Telerik.Windows.Diagrams.Core.Point((start.X + [end].X) / 2, (start.Y + [end].Y) / 2 - 50))
- pointList.Add(New Telerik.Windows.Diagrams.Core.Point((start.X + [end].X) / 2, (start.Y + [end].Y) / 2 + 50))
- pointList.Add(New Telerik.Windows.Diagrams.Core.Point(start.X + ([end].X - start.X) * 0.55, [end].Y))
- Return pointList
- End Function
-End Class
-
-````
-
-{{endregion}}
+
Please note that we only have to add in the list the route points, no need to add the start and the end point of the connection.
The final step is to make our router the current one of the __RadDiagram__. This is done via Diagram's Routing Service:
-{{source=..\SamplesCS\Diagram\DiagramRouting.cs region=SetCustomRouter}}
-{{source=..\SamplesVB\Diagram\DiagramRouting.vb region=SetCustomRouter}}
-
-````C#
-
-this.radDiagram1.RouteConnections = true;
-this.radDiagram1.RoutingService.Router = new CustomRouter();
+
+
-````
-````VB.NET
-Me.RadDiagram1.RouteConnections = True
-Me.RadDiagram1.RoutingService.Router = New CustomRouter()
-
-````
-
-{{endregion}}
+
diff --git a/controls/diagram/features/save-and-load-layout.md b/controls/diagram/features/save-and-load-layout.md
index ba592379a..4a2e17085 100644
--- a/controls/diagram/features/save-and-load-layout.md
+++ b/controls/diagram/features/save-and-load-layout.md
@@ -18,35 +18,10 @@ Here is a sample demonstrating how you can save the layout to a file:
#### Save Layout
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=SaveLayout}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=SaveLayout}}
+
+
-````C#
-
-string s = "default.xml";
-System.Windows.Forms.SaveFileDialog dialog = new System.Windows.Forms.SaveFileDialog();
-dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*";
-dialog.Title = "Select a xml file";
-if (dialog.ShowDialog() == DialogResult.OK)
-{
- s = dialog.FileName;
-}
-this.radDiagram1.SaveToFile(s);
-
-````
-````VB.NET
-Dim s As String = "default.xml"
-Dim dialog As New System.Windows.Forms.SaveFileDialog()
-dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*"
-dialog.Title = "Select a xml file"
-If dialog.ShowDialog() = DialogResult.OK Then
- s = dialog.FileName
-End If
-Me.radDiagram1.SaveToFile(s)
-
-````
-
-{{endregion}}
+
>note You can use the RadDiagram.**Save** method in case you need just the string representation of the XML data.
@@ -56,33 +31,9 @@ Here is a sample demonstrating how you can load the layout from a file:
#### Load Layout
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=LoadLayout}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=LoadLayout}}
-
-````C#
-string s = "default.xml";
-System.Windows.Forms.OpenFileDialog dialog = new System.Windows.Forms.OpenFileDialog();
-dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*";
-dialog.Title = "Select a xml file";
-if (dialog.ShowDialog() == DialogResult.OK)
-{
- s = dialog.FileName;
-}
-this.radDiagram1.LoadFromFile(s);
-
-````
-````VB.NET
-Dim s As String = "default.xml"
-Dim dialog As New System.Windows.Forms.OpenFileDialog()
-dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*"
-dialog.Title = "Select a xml file"
-If dialog.ShowDialog() = DialogResult.OK Then
- s = dialog.FileName
-End If
-Me.radDiagram1.LoadFromFile(s)
-
-````
+
+
-{{endregion}}
+
>note You can use the RadDiagram.**Load** method in order to load data from a string representation of the XML data.
diff --git a/controls/diagram/features/undo-and-redo.md b/controls/diagram/features/undo-and-redo.md
index 436571baf..4d166abca 100644
--- a/controls/diagram/features/undo-and-redo.md
+++ b/controls/diagram/features/undo-and-redo.md
@@ -23,33 +23,10 @@ __RadDiagram__ class exposes two methods that allow you to take advantage of the
* __Redo()__: this method reapplies the last operation that was undone in the __RadDiagram__.
-{{source=..\SamplesCS\Diagram\DiagramUndoRedo.cs region=UndoRedo}}
-{{source=..\SamplesVB\Diagram\DiagramUndoRedo.vb region=UndoRedo}}
+
+
-````C#
-
-private void radButtonUndo_Click(object sender, EventArgs e)
-{
- this.radDiagram1.Undo();
-}
-
-private void radButtonRedo_Click(object sender, EventArgs e)
-{
- this.radDiagram1.Redo();
-}
-
-````
-````VB.NET
-Private Sub RadButtonUndo_Click(sender As Object, e As EventArgs) Handles RadButtonUndo.Click
- Me.RadDiagram1.Undo()
-End Sub
-Private Sub RadButtonRedo_Click(sender As Object, e As EventArgs) Handles RadButtonRedo.Click
- Me.RadDiagram1.Redo()
-End Sub
-
-````
-
-{{endregion}}
+
@@ -65,21 +42,10 @@ Telerik Diagramming Framework exposes a set of commands that allow you to easily
>
-{{source=..\SamplesCS\Diagram\DiagramUndoRedo.cs region=CommandsUndoRedo}}
-{{source=..\SamplesVB\Diagram\DiagramUndoRedo.vb region=CommandsUndoRedo}}
+
+
-````C#
-this.radDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Undo);
-this.radDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Redo);
-
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Undo)
-Me.RadDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.Redo)
-
-````
-
-{{endregion}}
+
diff --git a/controls/diagram/information-adorner.md b/controls/diagram/information-adorner.md
index 40fb6b449..e92f70229 100644
--- a/controls/diagram/information-adorner.md
+++ b/controls/diagram/information-adorner.md
@@ -15,19 +15,10 @@ __RadDiagram__ shows information tool-tips that appear below the manipulation ad
__RadDiagram__ uses the __ItemInformationAdorner__ to visualize information regarding the position, size and rotation angle of its shapes.
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=EnableInformationAdorner}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=EnableInformationAdorner}}
+
+
-````C#
-this.radDiagram1.IsInformationAdornerVisible = true;
-
-````
-````VB.NET
-Me.RadDiagram1.IsInformationAdornerVisible = True
-
-````
-
-{{endregion}}
+
@@ -41,88 +32,20 @@ Fig.1 visualizes the X and Y component of the current position of the shape when
__ItemInformationAdorner__ can be customized in order to display additional elements, e.g. a button. To achieve it, you should create a derivative of the __Telerik.WinControls.UI.Diagrams.Primitives.ItemInformationAdorner__ class and override its __CreateChildElements__ method. Here is demonstrated a sample code snippet:
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=CustomItemInformationAdorner}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=CustomItemInformationAdorner}}
-
-````C#
-
-class MyItemInformationAdorner : Telerik.WinControls.UI.Diagrams.Primitives.ItemInformationAdorner
-{
- public MyItemInformationAdorner(RadDiagramElement diagram)
- {
- this.Diagram = diagram;
- }
-
- protected override void CreateChildElements()
- {
- base.CreateChildElements();
- RadButtonElement button = new RadButtonElement() { Text = "Click me!", AutoSize = true, TextAlignment = ContentAlignment.MiddleRight };
- this.InformationTipPanel.Children.First().Visibility = ElementVisibility.Collapsed;
- this.InformationTipPanel.Children.Add(button);
- button.ButtonFillElement.BackColor = System.Drawing.Color.Red;
- button.ButtonFillElement.GradientStyle = GradientStyles.Solid;
- button.Click += button_Click;
- }
- void button_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Hello");
- }
-}
-
-````
-````VB.NET
-Class MyItemInformationAdorner
-Inherits Telerik.WinControls.UI.Diagrams.Primitives.ItemInformationAdorner
- Public Sub New(diagram As RadDiagramElement)
- Me.Diagram = diagram
- End Sub
-
- Protected Overrides Sub CreateChildElements()
- MyBase.CreateChildElements()
- Dim button As New RadButtonElement() With { _
- .Text = "Click me!", _
- .AutoSize = True, _
- .TextAlignment = ContentAlignment.MiddleRight _
- }
- Me.InformationTipPanel.Children.First().Visibility = ElementVisibility.Collapsed
- Me.InformationTipPanel.Children.Add(Button)
- Button.ButtonFillElement.BackColor = System.Drawing.Color.Red
- Button.ButtonFillElement.GradientStyle = GradientStyles.Solid
- AddHandler Button.Click, AddressOf button_Click
- End Sub
- Private Sub button_Click(sender As Object, e As EventArgs)
- MessageBox.Show("Hello")
- End Sub
-End Class
-
-````
+
+
-{{endregion}}
+
Now, you should apply the custom __ItemInformationAdorner__ to __DiagramElement__:
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=AssignCustomItemInformationAdorner}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=AssignCustomItemInformationAdorner}}
-
-````C#
-this.radDiagram1.DiagramElement.ItemInformationAdorner = new MyItemInformationAdorner(this.radDiagram1.DiagramElement);
-Telerik.WinControls.UI.Diagrams.Primitives.ItemInformationAdorner item = this.radDiagram1.DiagramElement.ItemInformationAdorner;
-item.Width = 100;
-item.Height = 20;
-
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.ItemInformationAdorner = New MyItemInformationAdorner(Me.RadDiagram1.DiagramElement)
-Dim item As Telerik.WinControls.UI.Diagrams.Primitives.ItemInformationAdorner = Me.RadDiagram1.DiagramElement.ItemInformationAdorner
-item.Width = 100
-item.Height = 20
+
+
-````
-
-{{endregion}}
+
diff --git a/controls/diagram/items-manipulation/clipboard-operations.md b/controls/diagram/items-manipulation/clipboard-operations.md
index 824c0edc9..f0e927932 100644
--- a/controls/diagram/items-manipulation/clipboard-operations.md
+++ b/controls/diagram/items-manipulation/clipboard-operations.md
@@ -34,29 +34,10 @@ You can perform these operations in a single form, but you can also copy/cut and
You can use the __DiagramCommands__ "Cut", "Copy" and "Paste" in order to perform the standard clipboard operations.
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=ClipboardCommands}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=ClipboardCommands}}
-
-````C#
-this.radDiagram1.SelectedItem = shape1;
-this.radDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.Copy, "");
-this.radDiagram2.DiagramElement.TryExecuteCommand(DiagramCommands.Paste, "");
-this.radDiagram1.SelectedItem = shape2;
-this.radDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.Cut, "");
-this.radDiagram2.DiagramElement.TryExecuteCommand(DiagramCommands.Paste, "");
-
-````
-````VB.NET
-Me.RadDiagram1.SelectedItem = shape1
-Me.RadDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.Copy, "")
-Me.RadDiagram2.DiagramElement.TryExecuteCommand(DiagramCommands.Paste, "")
-Me.RadDiagram1.SelectedItem = shape2
-Me.RadDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.Cut, "")
-Me.RadDiagram2.DiagramElement.TryExecuteCommand(DiagramCommands.Paste, "")
-
-````
-
-{{endregion}}
+
+
+
+
diff --git a/controls/diagram/items-manipulation/editing.md b/controls/diagram/items-manipulation/editing.md
index 2eb32739f..43c84de32 100644
--- a/controls/diagram/items-manipulation/editing.md
+++ b/controls/diagram/items-manipulation/editing.md
@@ -21,19 +21,10 @@ By default, the __RadDiagramItems__ are enabled for editing. In order to disable

-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=IsEditable}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=IsEditable}}
+
+
-````C#
-this.radDiagram1.IsEditable = true;
-
-````
-````VB.NET
-Me.RadDiagram1.IsEditable = True
-
-````
-
-{{endregion}}
+
## Start Editing By Using Keyboard
@@ -56,27 +47,10 @@ In the code snippet below it is demonstrated how to access the editor element:
#### Access editor element
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=GetEditor}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=GetEditor}}
+
+
-````C#
-
-private void shape_BeginEdit(object sender, EventArgs e)
-{
- RadDiagramShape shape = sender as RadDiagramShape;
- RadTextBoxControlElement editorElement = shape.FindDescendant();
-}
-
-````
-````VB.NET
-Private Sub shape_BeginEdit(sender As Object, e As EventArgs)
- Dim shape As RadDiagramShape = TryCast(sender, RadDiagramShape)
- Dim editorElement As RadTextBoxControlElement = shape.FindDescendant(Of RadTextBoxControlElement)()
-End Sub
-
-````
-
-{{endregion}}
+
* __PreviewEndEdit__: fires when a __RadDiagramItem__ is about to leave the edit mode. It is cancelable.
@@ -93,40 +67,10 @@ __RadDiagram__ provides three predefined commands for editing the selected item

-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=EditCommands}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=EditCommands}}
+
+
-````C#
-
-private void radButtonEdit_Click(object sender, EventArgs e)
-{
- this.radDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.BeginEdit);
-}
-
-private void radButtonConfirm_Click(object sender, EventArgs e)
-{
- this.radDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.CommitEdit);
-}
-private void radButtonCancel_Click(object sender, EventArgs e)
-{
- this.radDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.CancelEdit);
-}
-
-````
-````VB.NET
-Private Sub RadButtonEdit_Click(sender As Object, e As EventArgs) Handles RadButtonEdit.Click
- Me.RadDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.BeginEdit)
-End Sub
-Private Sub RadButtonConfirm_Click(sender As Object, e As EventArgs) Handles RadButtonConfirm.Click
- Me.RadDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.CommitEdit)
-End Sub
-Private Sub RadButtonCancel_Click(sender As Object, e As EventArgs) Handles RadButtonCancel.Click
- Me.RadDiagram1.DiagramElement.TryExecuteCommand(Telerik.WinControls.UI.Diagrams.DiagramCommands.CancelEdit)
-End Sub
-
-````
-
-{{endregion}}
+
diff --git a/controls/diagram/items-manipulation/removing-items.md b/controls/diagram/items-manipulation/removing-items.md
index 372fd7bf9..9fb5fffd0 100644
--- a/controls/diagram/items-manipulation/removing-items.md
+++ b/controls/diagram/items-manipulation/removing-items.md
@@ -25,42 +25,20 @@ Below you can see the result of delete operation over the selected __RadDiagramI
You can remove __RadDiagramItems__ in code behind by using the RadDiagram.__Items__ collection and its __Remove()__ or __RemoveAt()__ methods:
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=RemoveItems}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=RemoveItems}}
+
+
-````C#
-this.radDiagram1.Items.RemoveAt(2);
-this.radDiagram1.Items.Remove(shape1);
-
-````
-````VB.NET
-Me.RadDiagram1.Items.RemoveAt(2)
-Me.RadDiagram1.Items.Remove(shape1)
-
-````
-
-{{endregion}}
+
## Delete with DiagramCommands
You can use the __DiagramCommand__ "Delete" in order to remove the selected __RadDiagramItems__.
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=DeleteCommands}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=DeleteCommands}}
+
+
-````C#
-this.radDiagram1.SelectedItem = shape1;
-this.radDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.Delete, "");
-
-````
-````VB.NET
-Me.RadDiagram1.SelectedItem = shape1
-Me.RadDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.Delete, "")
-
-````
-
-{{endregion}}
+
diff --git a/controls/diagram/items-manipulation/resizing.md b/controls/diagram/items-manipulation/resizing.md
index ff15f4521..aba1609b5 100644
--- a/controls/diagram/items-manipulation/resizing.md
+++ b/controls/diagram/items-manipulation/resizing.md
@@ -19,19 +19,10 @@ By default, the __RadDiagram__ is enabled for resizing manipulation. In order to

-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=EnableResizing}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=EnableResizing}}
+
+
-````C#
-this.radDiagram1.IsResizingEnabled = false;
-
-````
-````VB.NET
-Me.RadDiagram1.IsResizingEnabled = False
-
-````
-
-{{endregion}}
+
## Manipulation adorner
@@ -45,36 +36,10 @@ You can resize shapes by using their __Width__ and __Height__ properties:

-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=ResizeShape}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=ResizeShape}}
-
-````C#
-RadDiagramShape resizedShape = new RadDiagramShape()
-{
- Text = "",
- ElementShape = new RoundRectShape(5),
- BackColor = System.Drawing.Color.LightBlue
-};
-resizedShape.Width = 300;
-resizedShape.Height = 100;
-resizedShape.Position = new Telerik.Windows.Diagrams.Core.Point(10, 10);
-radDiagram1.Items.Add(resizedShape);
-
-````
-````VB.NET
-Dim resizedShape As New RadDiagramShape() With { _
- .Text = "", _
- .ElementShape = New RoundRectShape(5), _
- .BackColor = System.Drawing.Color.LightBlue _
-}
-resizedShape.Width = 300
-resizedShape.Height = 100
-resizedShape.Position = New Telerik.Windows.Diagrams.Core.Point(10, 10)
-RadDiagram1.Items.Add(resizedShape)
-
-````
-
-{{endregion}}
+
+
+
+
diff --git a/controls/diagram/items-manipulation/rotation.md b/controls/diagram/items-manipulation/rotation.md
index df0e68cd8..2f6333989 100644
--- a/controls/diagram/items-manipulation/rotation.md
+++ b/controls/diagram/items-manipulation/rotation.md
@@ -19,19 +19,10 @@ By default, the __RadDiagram__ is enabled for rotation manipulation. In order to

-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=EnableRotation}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=EnableRotation}}
+
+
-````C#
-this.radDiagram1.IsRotationEnabled = false;
-
-````
-````VB.NET
-Me.RadDiagram1.IsRotationEnabled = False
-
-````
-
-{{endregion}}
+
## Rotation Angle
@@ -40,30 +31,10 @@ You can rotate shapes by using their __RotationAngle__ property:

-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=RotationAngle}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=RotationAngle}}
+
+
-````C#
-RadDiagramShape sourceShape = new RadDiagramShape()
-{
- Text = "Text",
- BackColor = System.Drawing.Color.LightBlue,
- ElementShape = new TabVsShape(),
-};
-sourceShape.RotationAngle = 45;
-
-````
-````VB.NET
-Dim sourceShape As New RadDiagramShape() With { _
- .Text = "Text", _
- .BackColor = System.Drawing.Color.LightBlue, _
- .ElementShape = New TabVsShape() _
-}
-sourceShape.RotationAngle = 45
-
-````
-
-{{endregion}}
+
diff --git a/controls/diagram/items-manipulation/selection.md b/controls/diagram/items-manipulation/selection.md
index cea001a27..b7cf44fe7 100644
--- a/controls/diagram/items-manipulation/selection.md
+++ b/controls/diagram/items-manipulation/selection.md
@@ -46,49 +46,10 @@ In order to select items programmatically, you only need to set their __IsSelect

-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=IsSelected}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=IsSelected}}
-
-````C#
-RadDiagramShape shape1 = new RadDiagramShape()
-{
- Text = "",
- IsSelected = true,
- ElementShape = new RoundRectShape(5),
- BackColor = System.Drawing.Color.LightBlue
-};
-shape1.Position = new Telerik.Windows.Diagrams.Core.Point(10, 10);
-radDiagram1.AddShape(shape1);
-RadDiagramShape shape2 = new RadDiagramShape()
-{
- Text = "",
- ElementShape = new RoundRectShape(5),
- BackColor = System.Drawing.Color.LightGreen
-};
-shape2.Position = new Telerik.Windows.Diagrams.Core.Point(180, 10);
-radDiagram1.AddShape(shape2);
-
-````
-````VB.NET
-Dim shape1 As New RadDiagramShape() With { _
- .Text = "", _
- .IsSelected = True, _
- .ElementShape = New RoundRectShape(5), _
- .BackColor = System.Drawing.Color.LightBlue _
-}
-shape1.Position = New Telerik.Windows.Diagrams.Core.Point(10, 10)
-RadDiagram1.AddShape(shape1)
-Dim shape2 As New RadDiagramShape() With { _
- .Text = "", _
- .ElementShape = New RoundRectShape(5), _
- .BackColor = System.Drawing.Color.LightGreen _
-}
-shape2.Position = New Telerik.Windows.Diagrams.Core.Point(180, 10)
-RadDiagram1.AddShape(shape2)
-
-````
-
-{{endregion}}
+
+
+
+
When multiple items are selected, they are automatically added in one Selection Adorner:
@@ -96,53 +57,10 @@ When multiple items are selected, they are automatically added in one Selection

-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=MultipleSelection}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=MultipleSelection}}
+
+
-````C#
-
-RadDiagramShape shape1 = new RadDiagramShape()
-{
- Text = "",
- IsSelected = true,
- ElementShape = new RoundRectShape(5),
- BackColor = System.Drawing.Color.LightBlue
-};
-shape1.Position = new Telerik.Windows.Diagrams.Core.Point(10, 10);
-radDiagram1.AddShape(shape1);
-
-RadDiagramShape shape2 = new RadDiagramShape()
-{
- Text = "",
- IsSelected = true,
- ElementShape = new RoundRectShape(5),
- BackColor = System.Drawing.Color.LightGreen
-};
-shape2.Position = new Telerik.Windows.Diagrams.Core.Point(180, 10);
-radDiagram1.AddShape(shape2);
-
-````
-````VB.NET
-Dim shape1 As New RadDiagramShape() With { _
- .Text = "", _
- .IsSelected = True, _
- .ElementShape = New RoundRectShape(5), _
- .BackColor = System.Drawing.Color.LightBlue _
-}
-shape1.Position = New Telerik.Windows.Diagrams.Core.Point(10, 10)
-RadDiagram1.AddShape(shape1)
-Dim shape2 As New RadDiagramShape() With { _
- .Text = "", _
- .IsSelected = True, _
- .ElementShape = New RoundRectShape(5), _
- .BackColor = System.Drawing.Color.LightGreen _
-}
-shape2.Position = New Telerik.Windows.Diagrams.Core.Point(180, 10)
-RadDiagram1.AddShape(shape2)
-
-````
-
-{{endregion}}
+
@@ -151,19 +69,10 @@ You may also want to use the __SelectedIndex__ or the __SelectedItem__ property

-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=SelectedIndex}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=SelectedIndex}}
-
-````C#
-this.radDiagram1.SelectedIndex = 1;
-
-````
-````VB.NET
-Me.RadDiagram1.SelectedIndex = 1
+
+
-````
-
-{{endregion}}
+
@@ -172,20 +81,10 @@ Me.RadDiagram1.SelectedIndex = 1
You are able to select all __RadDiagramItems__ interactively (by Mouse or by pressing Ctrl + A), programmatically (via the __SelectAll__ method), set the __IsSelected__ property to every Shape and Connection. Below is demonstrated how you can use the __SelectAll__ command:
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=SelectAllCommand}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=SelectAllCommand}}
-
-````C#
-
-this.radDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.SelectAll, "");
+
+
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.SelectAll, "")
-
-````
-
-{{endregion}}
+
## Selections events
diff --git a/controls/diagram/items-manipulation/zorder.md b/controls/diagram/items-manipulation/zorder.md
index ee6e86c31..5d33ca05c 100644
--- a/controls/diagram/items-manipulation/zorder.md
+++ b/controls/diagram/items-manipulation/zorder.md
@@ -17,71 +17,10 @@ __RadDiagram__ gives you the ability to control the Z-Order of shapes and connec
Consider the following code:
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=ZOrder}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=ZOrder}}
-
-````C#
-
-RadDiagramShape shape1 = new RadDiagramShape()
-{
- Text = "shape1",
- ZIndex = 3,
- ElementShape = new EllipseShape(),
- BackColor = System.Drawing.Color.LightBlue
-};
-shape1.Position = new Telerik.Windows.Diagrams.Core.Point(100, 10);
-radDiagram1.AddShape(shape1);
-
-RadDiagramShape shape2 = new RadDiagramShape()
-{
- Text = "shape2",
- ZIndex = 2,
- ElementShape = new EllipseShape(),
- BackColor = System.Drawing.Color.LightGreen
-};
-shape2.Position = new Telerik.Windows.Diagrams.Core.Point(150, 60);
-radDiagram1.AddShape(shape2);
-
-RadDiagramShape shape3 = new RadDiagramShape()
-{
- Text = "shape3",
- ZIndex = 1,
- ElementShape = new EllipseShape(),
- BackColor = System.Drawing.Color.LightCoral
-};
-shape3.Position = new Telerik.Windows.Diagrams.Core.Point(60, 60);
-radDiagram1.AddShape(shape3);
-
-````
-````VB.NET
-Dim shape1 As New RadDiagramShape() With { _
- .Text = "shape1", _
- .ZIndex = 3, _
- .ElementShape = New EllipseShape(), _
- .BackColor = System.Drawing.Color.LightBlue _
-}
-shape1.Position = New Telerik.Windows.Diagrams.Core.Point(100, 10)
-RadDiagram1.AddShape(shape1)
-Dim shape2 As New RadDiagramShape() With { _
- .Text = "shape2", _
- .ZIndex = 2, _
- .ElementShape = New EllipseShape(), _
- .BackColor = System.Drawing.Color.LightGreen _
-}
-shape2.Position = New Telerik.Windows.Diagrams.Core.Point(150, 60)
-RadDiagram1.AddShape(shape2)
-Dim shape3 As New RadDiagramShape() With { _
- .Text = "shape3", _
- .ZIndex = 1, _
- .ElementShape = New EllipseShape(), _
- .BackColor = System.Drawing.Color.LightCoral _
-}
-shape3.Position = New Telerik.Windows.Diagrams.Core.Point(60, 60)
-radDiagram1.AddShape(shape3)
-
-````
-
-{{endregion}}
+
+
+
+
We have reversed the natural ZOrder of the 3 Shapes.
@@ -92,109 +31,10 @@ We have reversed the natural ZOrder of the 3 Shapes.
__RadDiagram__ provides a set of predefined commands for manipulating the selected items' ZIndices. "BringForward" and "SendBackward" allow you to increase/decrease the Z-Indices of the selected __RadDiagramItems__. If you need to bring the selected item(s) on top of all other items or below them, you can use "BringToFront" and "SentToback":
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=CommandZIndex}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=CommandZIndex}}
-
-````C#
-
-RadDiagramShape shape1 = new RadDiagramShape()
-{
- Text = "shape1",
- ZIndex = 1,
- ElementShape = new EllipseShape(),
- BackColor = System.Drawing.Color.LightBlue
-};
-shape1.Position = new Telerik.Windows.Diagrams.Core.Point(100, 10);
-radDiagram1.AddShape(shape1);
-
-RadDiagramShape shape2 = new RadDiagramShape()
-{
- Text = "shape2",
- ZIndex = 2,
- ElementShape = new EllipseShape(),
- BackColor = System.Drawing.Color.LightGreen
-};
-shape2.Position = new Telerik.Windows.Diagrams.Core.Point(150, 80);
-radDiagram1.AddShape(shape2);
-
-RadDiagramShape shape3 = new RadDiagramShape()
-{
- Text = "shape3",
- ZIndex = 3,
- ElementShape = new EllipseShape(),
- BackColor = System.Drawing.Color.LightCoral
-};
-shape3.Position = new Telerik.Windows.Diagrams.Core.Point(60, 80);
-radDiagram1.AddShape(shape3);
-
-RadDiagramConnection connection1 = new RadDiagramConnection() { Name = "connection1" };
-connection1.Source = shape1;
-connection1.Target = shape2;
-connection1.ZIndex = 2;
-connection1.SourceConnectorPosition = "Right";
-connection1.TargetConnectorPosition = "Right";
-
-radDiagram1.Items.Add(connection1);
-
-RadDiagramConnection connection2 = new RadDiagramConnection()
-{
- Name = "connection2"
-};
-connection2.Source = shape1;
-connection2.Target = shape3;
-connection2.ZIndex = 1;
-connection2.SourceConnectorPosition = "Left";
-connection2.TargetConnectorPosition = "Left";
-radDiagram1.Items.Add(connection2);
-
-````
-````VB.NET
-Dim shape1 As New RadDiagramShape() With { _
- .Text = "shape1", _
- .ZIndex = 1, _
- .ElementShape = New EllipseShape(), _
- .BackColor = System.Drawing.Color.LightBlue _
-}
-shape1.Position = New Telerik.Windows.Diagrams.Core.Point(100, 10)
-radDiagram1.AddShape(shape1)
-Dim shape2 As New RadDiagramShape() With { _
- .Text = "shape2", _
- .ZIndex = 2, _
- .ElementShape = New EllipseShape(), _
- .BackColor = System.Drawing.Color.LightGreen _
-}
-shape2.Position = New Telerik.Windows.Diagrams.Core.Point(150, 80)
-RadDiagram1.AddShape(shape2)
-Dim shape3 As New RadDiagramShape() With { _
- .Text = "shape3", _
- .ZIndex = 3, _
- .ElementShape = New EllipseShape(), _
- .BackColor = System.Drawing.Color.LightCoral _
-}
-shape3.Position = New Telerik.Windows.Diagrams.Core.Point(60, 80)
-RadDiagram1.AddShape(shape3)
-Dim connection1 As New RadDiagramConnection() With { _
- .Name = "aaaa" _
-}
-connection1.Source = shape1
-connection1.Target = shape2
-connection1.ZIndex = 2
-connection1.SourceConnectorPosition = "Right"
-connection1.TargetConnectorPosition = "Right"
-RadDiagram1.Items.Add(connection1)
-Dim connection2 As New RadDiagramConnection() With { _
- .Name = "bbbb" _
-}
-connection2.Source = shape1
-connection2.Target = shape3
-connection2.ZIndex = 1
-connection2.SourceConnectorPosition = "Left"
-connection2.TargetConnectorPosition = "Left"
-radDiagram1.Items.Add(connection2)
-
-````
-
-{{endregion}}
+
+
+
+
@@ -208,22 +48,10 @@ Here is the result of selecting the first shape and executing the DiagramCommand

-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=BringToFront}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=BringToFront}}
-
-````C#
-
-this.radDiagram1.SelectedItem = shape1;
-this.radDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.BringToFront, "");
-
-````
-````VB.NET
-Me.RadDiagram1.SelectedItem = shape1
-Me.RadDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.BringToFront, "")
+
+
-````
-
-{{endregion}}
+
Here is the result of selecting the third shape and executing the DiagramCommands.__SendToBack__:
@@ -231,22 +59,10 @@ Here is the result of selecting the third shape and executing the DiagramCommand

-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=SendToBack}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=SendToBack}}
-
-````C#
-
-this.radDiagram1.SelectedItem = shape3;
-this.radDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.SendToBack, "");
+
+
-````
-````VB.NET
-Me.RadDiagram1.SelectedItem = shape3
-Me.RadDiagram1.DiagramElement.TryExecuteCommand(DiagramCommands.SendToBack, "")
-
-````
-
-{{endregion}}
+
diff --git a/controls/diagram/localization.md b/controls/diagram/localization.md
index c46511608..d411c3879 100644
--- a/controls/diagram/localization.md
+++ b/controls/diagram/localization.md
@@ -24,63 +24,16 @@ To localize __RadDiagramRibbonBar__ to display control text and messages in a sp
2\. Override the __GetLocalizedString(string id)__ method and provide a translation for the texts. If a translation is not provided, the default value will be returned. This behavior is guaranteed by the call to the base __GetLocalizedString__ method in the default clause of the switch statement in the example. Below is a sample implementation of a custom localization provider:
-{{source=..\SamplesCS\Diagram\DiagramLocalization.cs region=RibbonUILocalization}}
-{{source=..\SamplesVB\Diagram\DiagramLocalization.vb region=RibbonUILocalization}}
+
+
-````C#
-
-public class MyDiagramRibbonBarLocalizationProvider : DiagramRibbonBarLocalizationProvider
-{
- public override string GetLocalizedString(string id)
- {
- switch (id)
- {
- case DiagramRibbonBarStringId.DiagramRibbonBarHomeTab:
- return "MyHome";
- case DiagramRibbonBarStringId.DiagramRibbonBarButtonOpen:
- return "MyOpen";
- default:
- return base.GetLocalizedString(id);
- }
- }
-}
-
-````
-````VB.NET
-Public Class MyDiagramRibbonBarLocalizationProvider
- Inherits DiagramRibbonBarLocalizationProvider
- Public Overrides Function GetLocalizedString(id As String) As String
- Select Case id
- Case DiagramRibbonBarStringId.DiagramRibbonBarHomeTab
- Return "MyHome"
- Case DiagramRibbonBarStringId.DiagramRibbonBarButtonOpen
- Return "MyOpen"
- Case Else
- Return MyBase.GetLocalizedString(id)
- End Select
- End Function
-End Class
-
-````
-
-{{endregion}}
-
-3\. To apply the custom localization provider, instantiate and assign it to the current localization provider:
-{{source=..\SamplesCS\Diagram\DiagramLocalization.cs region=SetRibbonUILocalization}}
-{{source=..\SamplesVB\Diagram\DiagramLocalization.vb region=SetRibbonUILocalization}}
-````C#
-
-DiagramRibbonBarLocalizationProvider.CurrentProvider = new MyDiagramRibbonBarLocalizationProvider();
-
-````
-````VB.NET
-DiagramRibbonBarLocalizationProvider.CurrentProvider = New MyDiagramRibbonBarLocalizationProvider()
+3\. To apply the custom localization provider, instantiate and assign it to the current localization provider:
-````
+
+
-{{endregion}}

@@ -95,71 +48,16 @@ To localize __RadDiagramSettingsPane__ to display control text and messages in a
2\. Override the __GetLocalizedString(string id)__ method and provide a translation for the texts. If a translation is not provided, the default value will be returned. This behavior is guaranteed by the call to the base __GetLocalizedString__ method in the default clause of the switch statement in the example.
-{{source=..\SamplesCS\Diagram\DiagramLocalization.cs region=SettingsPaneLocalization}}
-{{source=..\SamplesVB\Diagram\DiagramLocalization.vb region=SettingsPaneLocalization}}
-
-````C#
-
-public class MyDiagramSettingsPaneLocalizationProvider : DiagramSettingsPaneLocalizationProvider
-{
- public override string GetLocalizedString(string id)
- {
- switch (id)
- {
- case DiagramSettingsPaneStringId.LabelCopy:
- return "MyCopy";
- case DiagramSettingsPaneStringId.LabelPaste:
- return "MyPaste";
- case DiagramSettingsPaneStringId.LabelCut:
- return "MyCut";
- case DiagramSettingsPaneStringId.LabelDelete:
- return "MyDelete";
- default:
- return base.GetLocalizedString(id);
- }
- }
-}
-
-````
-````VB.NET
-Public Class MyDiagramSettingsPaneLocalizationProvider
- Inherits DiagramSettingsPaneLocalizationProvider
- Public Overrides Function GetLocalizedString(id As String) As String
- Select Case id
- Case DiagramSettingsPaneStringId.LabelCopy
- Return "MyCopy"
- Case DiagramSettingsPaneStringId.LabelPaste
- Return "MyPaste"
- Case DiagramSettingsPaneStringId.LabelCut
- Return "MyCut"
- Case DiagramSettingsPaneStringId.LabelDelete
- Return "MyDelete"
- Case Else
- Return MyBase.GetLocalizedString(id)
- End Select
- End Function
-End Class
-
-````
-
-{{endregion}}
+
+
-3\. To apply the custom localization provider, instantiate and assign it to the current localization provider:
-{{source=..\SamplesCS\Diagram\DiagramLocalization.cs region=SetSettingsPaneLocalization}}
-{{source=..\SamplesVB\Diagram\DiagramLocalization.vb region=SetSettingsPaneLocalization}}
-````C#
-
-DiagramSettingsPaneLocalizationProvider.CurrentProvider = new MyDiagramSettingsPaneLocalizationProvider();
-
-````
-````VB.NET
-DiagramSettingsPaneLocalizationProvider.CurrentProvider = New MyDiagramSettingsPaneLocalizationProvider()
+3\. To apply the custom localization provider, instantiate and assign it to the current localization provider:
-````
+
+
-{{endregion}}

diff --git a/controls/diagram/populating-with-data.md b/controls/diagram/populating-with-data.md
index e93672278..56e4a06b3 100644
--- a/controls/diagram/populating-with-data.md
+++ b/controls/diagram/populating-with-data.md
@@ -17,91 +17,9 @@ This article will demonstrate how to define shapes and connections programmatica
Below you can find a code snippet which creates three shapes and connections between them:
-{{source=..\SamplesCS\Diagram\DiagramPopulatingWithData.cs region=PopulateData}}
-{{source=..\SamplesVB\Diagram\DiagramPopulatingWithData.vb region=PopulateData}}
-
-````C#
-
-RadDiagramShape shape1 = new RadDiagramShape()
-{
- Text = "Second Level Domain",
- ElementShape = new RoundRectShape(4),
- BackColor = Color.LimeGreen
-};
-shape1.Position = new Telerik.Windows.Diagrams.Core.Point(100, 100);
-radDiagram1.Items.Add(shape1);
-
-RadDiagramShape shape2 = new RadDiagramShape()
-{
- Text = "Top Level Domain",
- ElementShape = new RoundRectShape(50),
- BackColor = Color.Cyan
-};
-shape2.Position = new Telerik.Windows.Diagrams.Core.Point(400, 100);
-radDiagram1.Items.Add(shape2);
-
-RadDiagramShape shape3 = new RadDiagramShape()
-{
- Text = "Organization Domain",
- ElementShape = new RoundRectShape(20),
- BackColor = Color.Yellow
-};
-shape3.Position = new Telerik.Windows.Diagrams.Core.Point(400, 400);
-radDiagram1.Items.Add(shape3);
-
-RadDiagramConnection connection1 = new RadDiagramConnection()
-{ Name = "connection1" };
-connection1.Source = shape1;
-connection1.Target = shape2;
-radDiagram1.Items.Add(connection1);
-
-RadDiagramConnection connection2 = new RadDiagramConnection()
-{
- Name = "connection2"
-};
-connection2.Source = shape1;
-connection2.Target = shape3;
-radDiagram1.Items.Add(connection2);
+
+
-````
-````VB.NET
-Dim shape1 As New RadDiagramShape() With { _
- .Text = "Second Level Domain", _
- .ElementShape = New RoundRectShape(4), _
- .BackColor = Color.LimeGreen _
-}
-shape1.Position = New Telerik.Windows.Diagrams.Core.Point(100, 100)
-RadDiagram1.Items.Add(shape1)
-Dim shape2 As New RadDiagramShape() With { _
- .Text = "Top Level Domain", _
- .ElementShape = New RoundRectShape(50), _
- .BackColor = Color.Cyan _
-}
-shape2.Position = New Telerik.Windows.Diagrams.Core.Point(400, 100)
-RadDiagram1.Items.Add(shape2)
-Dim shape3 As New RadDiagramShape() With { _
- .Text = "Organization Domain", _
- .ElementShape = New RoundRectShape(20), _
- .BackColor = Color.Yellow _
-}
-shape3.Position = New Telerik.Windows.Diagrams.Core.Point(400, 400)
-RadDiagram1.Items.Add(shape3)
-Dim connection1 As New RadDiagramConnection() With { _
- .Name = "connection1" _
-}
-connection1.Source = shape1
-connection1.Target = shape2
-RadDiagram1.Items.Add(connection1)
-Dim connection2 As New RadDiagramConnection() With { _
- .Name = "connection2" _
-}
-connection2.Source = shape1
-connection2.Target = shape3
-RadDiagram1.Items.Add(connection2)
-
-````
-
-{{endregion}}

@@ -110,54 +28,8 @@ RadDiagram1.Items.Add(connection2)
You can load items in __RadDiagram__ from XML. Here is a sample code snippet:
-{{source=..\SamplesCS\Diagram\DiagramPopulatingWithData.cs region=LoadFromXML}}
-{{source=..\SamplesVB\Diagram\DiagramPopulatingWithData.vb region=LoadFromXML}}
-
-````C#
-
-OpenFileDialog openFileDialog1 = new OpenFileDialog();
-
-openFileDialog1.InitialDirectory = "c:\\";
-openFileDialog1.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*";
-openFileDialog1.RestoreDirectory = true;
-
-if (openFileDialog1.ShowDialog() == DialogResult.OK)
-{
- string filename = openFileDialog1.FileName;
-
- string filelines = File.ReadAllText(filename);
- try
- {
- radDiagram1.DiagramElement.Items.Clear();
- radDiagram1.DiagramElement.Load(filelines);
- }
- catch (Exception ex)
- {
- MessageBox.Show("Unable to load " + filename + "\nError: " + ex.Message);
- }
-}
-
-````
-````VB.NET
-Dim openFileDialog1 As New OpenFileDialog()
-openFileDialog1.InitialDirectory = "c:\"
-openFileDialog1.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*"
-openFileDialog1.RestoreDirectory = True
-If openFileDialog1.ShowDialog() = DialogResult.OK Then
- Dim filename As String = openFileDialog1.FileName
- Dim filelines As String = File.ReadAllText(filename)
- Try
- RadDiagram1.DiagramElement.Items.Clear()
- RadDiagram1.DiagramElement.Load(filelines)
- Catch ex As Exception
- MessageBox.Show((Convert.ToString("Unable to load ") & filename) + vbLf & "Error: " + ex.Message)
- End Try
-End If
-
-````
-
-{{endregion}}
-
+
+
diff --git a/controls/diagram/settings-pane.md b/controls/diagram/settings-pane.md
index 828e9e023..1aa5e0f80 100644
--- a/controls/diagram/settings-pane.md
+++ b/controls/diagram/settings-pane.md
@@ -18,19 +18,10 @@ This article will get you familiar with the __SettingsPane__ that is part of __R
The __SettingsPane__ control allows the users to examine and modify the settings of the diagramming items at run-time.
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=SettingsPane}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=SettingsPane}}
+
+
-````C#
-this.radDiagram1.IsSettingsPaneEnabled = true;
-
-````
-````VB.NET
-Me.RadDiagram1.IsSettingsPaneEnabled = True
-
-````
-
-{{endregion}}
+
@@ -50,21 +41,10 @@ The __SettingsPane__ control is a standalone control that can be displayed as th
In order to display the DiagramElement.__SettingsPane__ in your application, you should click the AdditionalContent of the __ItemInformationAdorner__ which can be accessed as below:
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=AdditionalContent}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=AdditionalContent}}
+
+
-````C#
-RadButtonElement additionalContent = Telerik.WinControls.UI.Diagrams.Primitives.ItemInformationAdorner.GetAdditionalContent(
- this.radDiagram1.DiagramElement.ItemInformationAdorner) as RadButtonElement;
-
-````
-````VB.NET
-Dim additionalContent As RadButtonElement = TryCast(Telerik.WinControls.UI.Diagrams.Primitives.ItemInformationAdorner.GetAdditionalContent( _
-Me.RadDiagram1.DiagramElement.ItemInformationAdorner), RadButtonElement)
-
-````
-
-{{endregion}}
+
## Customization
@@ -75,25 +55,10 @@ The __SettingsPane__ has a default view that can be used out-of-the-box in scena
* __Add and remove tabs__ - in order to add or remove tabs from the default __SettingsPane__, you need to add or remove a __RadPageViewPage__ to or from the DiagramElement.SettingsPane.RadPageView.__Pages__ as this is the control that represents the content of the __SettingsPane__.
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=AddRemoveTabs}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=AddRemoveTabs}}
+
+
-````C#
-this.radDiagram1.DiagramElement.SettingsPane.RadPageView.Pages.Remove(this.radDiagram1.DiagramElement.SettingsPane.RadPageViewPageHome);
-RadPageViewPage toolsPage = new RadPageViewPage();
-toolsPage.Text = "Tools";
-this.radDiagram1.DiagramElement.SettingsPane.RadPageView.Pages.Add(toolsPage);
-
-````
-````VB.NET
-Me.RadDiagram1.DiagramElement.SettingsPane.RadPageView.Pages.Remove(Me.RadDiagram1.DiagramElement.SettingsPane.RadPageViewPageHome)
-Dim toolsPage As New RadPageViewPage()
-toolsPage.Text = "Tools"
-Me.RadDiagram1.DiagramElement.SettingsPane.RadPageView.Pages.Add(toolsPage)
-
-````
-
-{{endregion}}
+
@@ -119,30 +84,10 @@ Me.RadDiagram1.DiagramElement.SettingsPane.RadPageView.Pages.Add(toolsPage)
>note You have access to each control in every of the default content pages. Hence, you can add, remove, edit controls:
>
-{{source=..\SamplesCS\Diagram\DiagramItemsManipulation.cs region=EditTabs}}
-{{source=..\SamplesVB\Diagram\DiagramItemsManipulation.vb region=EditTabs}}
+
+
-````C#
-RadButton myButton = new RadButton();
-myButton.Text = "New";
-myButton.Size = this.radDiagram1.DiagramElement.SettingsPane.RadButtonCut.Size;
-myButton.Location = this.radDiagram1.DiagramElement.SettingsPane.RadButtonCut.Location;
-this.radDiagram1.DiagramElement.SettingsPane.PanelCopyCutPaste.Controls.Add(myButton);
-this.radDiagram1.DiagramElement.SettingsPane.RadButtonCut.Visible = false;
-
-````
-````VB.NET
-Dim myButton As New RadButton()
-myButton.Text = "New"
-myButton.Size = Me.RadDiagram1.DiagramElement.SettingsPane.RadButtonCut.Size
-myButton.Location = Me.RadDiagram1.DiagramElement.SettingsPane.RadButtonCut.Location
-Me.RadDiagram1.DiagramElement.SettingsPane.PanelCopyCutPaste.Controls.Add(myButton)
-Me.RadDiagram1.DiagramElement.SettingsPane.RadButtonCut.Visible = False
-
-````
-
-{{endregion}}
diff --git a/controls/dock/architecture-and-features/dockingguidestemplate.md b/controls/dock/architecture-and-features/dockingguidestemplate.md
index 7f71ffc28..a191f23d8 100644
--- a/controls/dock/architecture-and-features/dockingguidestemplate.md
+++ b/controls/dock/architecture-and-features/dockingguidestemplate.md
@@ -31,20 +31,10 @@ __RadDock__ comes with four predefined docking guides templates:
By default, __RadDock__ uses the VS2010 template. In order to use the VS2008 template, you can set it as shown below:
-{{source=..\SamplesCS\Dock\dock-architecture-and-features-docking-guides-template.cs region=VS2008}}
-{{source=..\SamplesVB\Dock\dock-architecture-and-features-docking-guides-template.vb region=VS2008}}
+
+
-````C#
-
-this.radDock1.DockingGuidesTemplate = PredefinedDockingGuidesTemplate.VS2008;
-
-````
-````VB.NET
-Me.RadDock1.DockingGuidesTemplate = PredefinedDockingGuidesTemplate.VS2008
-
-````
-
-{{endregion}}
+
## Creating a custom docking guides template
@@ -60,71 +50,10 @@ For our custom **DockingGuidesTemplate** we will use the following images (used
We should first create a **DockingGuidesTemplate** object and then set the images and their locations on the center background image. **RadDock** will define its hot mouse areas on the **CenterBackground** image depending on the images' locations that we set. The left, top, right and bottom images are reused for the outer guides (outside the center "compass"):
-{{source=..\SamplesCS\Dock\dock-architecture-and-features-docking-guides-template.cs region=Template}}
-{{source=..\SamplesVB\Dock\dock-architecture-and-features-docking-guides-template.vb region=Template}}
-
-````C#
-DockingGuidesTemplate template;
-
-void Form1_Load(object sender, EventArgs e)
-{
- template = new DockingGuidesTemplate();
-
- template.DockingHintBackColor = Color.FromArgb(30, Color.Green);
- template.DockingHintBorderColor = Color.FromArgb(30, Color.DarkGreen);
-
- template.LeftImage.Image = Properties.Resources.Left;
- template.TopImage.Image = Properties.Resources.Top;
- template.RightImage.Image = Properties.Resources.Right;
- template.BottomImage.Image = Properties.Resources.Bottom;
- template.FillImage.Image = Properties.Resources.Fill;
-
- template.LeftImage.HotImage = Properties.Resources.LeftHot;
- template.TopImage.HotImage = Properties.Resources.TopHot;
- template.RightImage.HotImage = Properties.Resources.RightHot;
- template.BottomImage.HotImage = Properties.Resources.BottomHot;
- template.FillImage.HotImage = Properties.Resources.FillHot;
-
- template.CenterBackgroundImage.Image = Properties.Resources.Center;
-
- template.LeftImage.LocationOnCenterGuide = new Point(0, 28);
- template.TopImage.LocationOnCenterGuide = new Point(28, 0);
- template.RightImage.LocationOnCenterGuide = new Point(65, 28);
- template.BottomImage.LocationOnCenterGuide = new Point(28, 65);
- template.FillImage.LocationOnCenterGuide = new Point(28, 28);
-
- this.radDock1.DockingGuidesTemplate = template;
-}
-
-````
-````VB.NET
-Private template As DockingGuidesTemplate
-Private Sub Form1_Load(sender As Object, e As EventArgs)
- template = New DockingGuidesTemplate()
- template.DockingHintBackColor = Color.FromArgb(30, Color.Green)
- template.DockingHintBorderColor = Color.FromArgb(30, Color.DarkGreen)
- template.LeftImage.Image = Resources.Left
- template.TopImage.Image = Resources.Top
- template.RightImage.Image = Resources.Right
- template.BottomImage.Image = Resources.Bottom
- template.FillImage.Image = Resources.Fill
- template.LeftImage.HotImage = Resources.LeftHot
- template.TopImage.HotImage = Resources.TopHot
- template.RightImage.HotImage = Resources.RightHot
- template.BottomImage.HotImage = Resources.BottomHot
- template.FillImage.HotImage = Resources.FillHot
- template.CenterBackgroundImage.Image = Resources.Center
- template.LeftImage.LocationOnCenterGuide = New Point(0, 28)
- template.TopImage.LocationOnCenterGuide = New Point(28, 0)
- template.RightImage.LocationOnCenterGuide = New Point(65, 28)
- template.BottomImage.LocationOnCenterGuide = New Point(28, 65)
- template.FillImage.LocationOnCenterGuide = New Point(28, 28)
- Me.RadDock1.DockingGuidesTemplate = template
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
As you can see in the code snippet, we are setting the __DockingHintBackColor__ and __DockingHintBorderColor__ properties which determine the colors of the docking hint area. The result is shown on the figure below:
diff --git a/controls/dock/architecture-and-features/document-manager.md b/controls/dock/architecture-and-features/document-manager.md
index 11acc8a2a..72bd264c4 100644
--- a/controls/dock/architecture-and-features/document-manager.md
+++ b/controls/dock/architecture-and-features/document-manager.md
@@ -20,23 +20,10 @@ This property allows you to get the currently active document among the document

#### Get the active DocumentWindow\ToolWindow
-{{source=..\SamplesCS\Dock\DocumentManager1.cs region=activeWindows}}
-{{source=..\SamplesVB\Dock\DocumentManager1.vb region=activeWindows}}
+
+
-````C#
-DockWindow activeDocument = this.radDock1.DocumentManager.ActiveDocument; //documentWindow2
-DockWindow activeWindow = this.radDock1.ActiveWindow; //toolWindow2
-//set active window/document
-this.radDock1.ActiveWindow = activeDocument;
-
-````
-````VB.NET
-Dim activeDocument As DockWindow = Me.RadDock1.DocumentManager.ActiveDocument 'documentWindow2
-Dim activeWindow As DockWindow = Me.RadDock1.ActiveWindow 'toolWindow2
-
-````
-
-{{endregion}}
+
## BoldActiveDocument
@@ -44,19 +31,10 @@ Determines whether the currently active document's **Text** will be displayed i
#### Use the __BoldActiveDocument__ property
-{{source=..\SamplesCS\Dock\DocumentManager1.cs region=boldActive}}
-{{source=..\SamplesVB\Dock\DocumentManager1.vb region=boldActive}}
+
+
-````C#
-this.radDock1.DocumentManager.BoldActiveDocument = false;
-
-````
-````VB.NET
-Me.RadDock1.DocumentManager.BoldActiveDocument = False
-
-````
-
-{{endregion}}
+
## DocumentInsertOrder
@@ -64,19 +42,10 @@ Gets or sets the insert order to be used when adding new documents. By default,
#### Set the __DocumentInsertOrder__ property
-{{source=..\SamplesCS\Dock\DocumentManager2.cs region=insertOrderInFront}}
-{{source=..\SamplesVB\Dock\DocumentManager2.vb region=insertOrderInFront}}
+
+
-````C#
-this.radDock1.DocumentManager.DocumentInsertOrder = DockWindowInsertOrder.InFront;
-
-````
-````VB.NET
-Me.RadDock1.DocumentManager.DocumentInsertOrder = DockWindowInsertOrder.InFront
-
-````
-
-{{endregion}}
+
>caption Figure 1: New DocumentWindows are inserted before the first window.
@@ -86,19 +55,10 @@ The other available option for this property is *ToBack.* The behavior of **Docu
#### Use the *ToBack* insert order
-{{source=..\SamplesCS\Dock\DocumentManager2.cs region=insertOrderToBack}}
-{{source=..\SamplesVB\Dock\DocumentManager2.vb region=insertOrderToBack}}
+
+
-````C#
-this.radDock1.DocumentManager.DocumentInsertOrder = DockWindowInsertOrder.ToBack;
-
-````
-````VB.NET
-Me.RadDock1.DocumentManager.DocumentInsertOrder = DockWindowInsertOrder.ToBack
-
-````
-
-{{endregion}}
+
>caption Figure 2: New Document windows are inserted after the first window.
diff --git a/controls/dock/architecture-and-features/floating-windows.md b/controls/dock/architecture-and-features/floating-windows.md
index 94c21b854..d45b64bbd 100644
--- a/controls/dock/architecture-and-features/floating-windows.md
+++ b/controls/dock/architecture-and-features/floating-windows.md
@@ -73,19 +73,10 @@ You can drag document windows to an existing floating container. Select left, ri
To enable the Visual Studio 2008-like docking behavior, set the __SingleScreen__ property to *true*. Enabling this property will prevent document windows from floating and from docking inside existing floating windows.
-{{source=..\SamplesCS\Dock\ArchitectureAndFeatures.cs region=floatingTabsMode}}
-{{source=..\SamplesVB\Dock\ArchitectureAndFeatures.vb region=floatingTabsMode}}
+
+
-````C#
-this.radDock1.SingleScreen = true;
-
-````
-````VB.NET
-Me.RadDock1.SingleScreen = True
-
-````
-
-{{endregion}}
+
## Properties
diff --git a/controls/dock/architecture-and-features/using-the-commandmanager.md b/controls/dock/architecture-and-features/using-the-commandmanager.md
index 0f9736da8..299d12ce1 100644
--- a/controls/dock/architecture-and-features/using-the-commandmanager.md
+++ b/controls/dock/architecture-and-features/using-the-commandmanager.md
@@ -27,28 +27,10 @@ The names of all predefined commands may be found in the static **PredefinedComm
You may easily specify custom shortcut for any of the predefined commands like this:
-{{source=..\SamplesCS\Dock\UsingCommandManager.cs region=Shortcut}}
-{{source=..\SamplesVB\Dock\UsingCommandManager.vb region=Shortcut}}
-
-````C#
-private void ChangeNextDocumentShortcut()
-{
- RadDockCommand command = this.radDock1.CommandManager.FindCommandByName(PredefinedCommandNames.NextDocument);
- command.Shortcuts.Clear();
- command.Shortcuts.Add(new RadShortcut(Keys.Shift, Keys.A, Keys.S));
-}
-
-````
-````VB.NET
-Private Sub ChangeNextDocumentShortcut()
- Dim command As RadDockCommand = Me.radDock1.CommandManager.FindCommandByName(PredefinedCommandNames.NextDocument)
- command.Shortcuts.Clear()
- command.Shortcuts.Add(New RadShortcut(Keys.Shift, Keys.A, Keys.S))
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
The above code specifies the **SHIFT+A+S** as a valid key combination that will trigger the **NextDocument** command.
@@ -58,90 +40,18 @@ The completely transparent object model of the command manager allows you to cre
#### Define the custom command class
-{{source=..\SamplesCS\Dock\UsingCommandManager.cs region=RadDockCommand}}
-{{source=..\SamplesVB\Dock\UsingCommandManager.vb region=RadDockCommand}}
-
-````C#
-public class FloatWindowCommand : RadDockCommand
-{
- public FloatWindowCommand()
- {
- this.Name = "FloatWindow";
- this.Shortcuts.Add(new RadShortcut(Keys.Control, Keys.F));
- }
- public override bool CanExecute(object parameter)
- {
- RadDock dock = parameter as RadDock;
- if (dock == null)
- {
- return false;
- }
- return dock.ActiveWindow is ToolWindow;
- }
- public override object Execute(params object[] settings)
- {
- RadDock dock = settings[0] as RadDock;
- Debug.Assert(dock != null, "Invalid execute parameter!");
- ToolWindow toolWindow = dock.ActiveWindow as ToolWindow;
- if (toolWindow != null)
- {
- dock.FloatWindow(toolWindow);
- }
- return base.Execute(settings);
- }
-}
-
-````
-````VB.NET
-Public Class FloatWindowCommand
- Inherits RadDockCommand
- Public Sub New()
- Me.Name = "FloatWindow"
- Me.Shortcuts.Add(New RadShortcut(Keys.Control, Keys.F))
- End Sub
- Public Overrides Function CanExecute(parameter As Object) As Boolean
- Dim dock As RadDock = TryCast(parameter, RadDock)
- If dock Is Nothing Then
- Return False
- End If
- Return TypeOf dock.ActiveWindow Is ToolWindow
- End Function
- Public Overrides Function Execute(ParamArray settings As Object()) As Object
- Dim dock As RadDock = TryCast(settings(0), RadDock)
- Debug.Assert(dock IsNot Nothing, "Invalid execute parameter!")
- Dim toolWindow As ToolWindow = TryCast(dock.ActiveWindow, ToolWindow)
- If toolWindow IsNot Nothing Then
- dock.FloatWindow(toolWindow)
- End If
- Return MyBase.Execute(settings)
- End Function
-End Class
-
-````
-
-{{endregion}}
+
+
+
+
#### Register the custom command
-{{source=..\SamplesCS\Dock\UsingCommandManager.cs region=RegisterCustomCommand}}
-{{source=..\SamplesVB\Dock\UsingCommandManager.vb region=RegisterCustomCommand}}
-
-````C#
-private void RegisterCustomCommand()
-{
- this.radDock1.CommandManager.RegisterCommand(new FloatWindowCommand());
-}
-
-````
-````VB.NET
-Private Sub RegisterCustomCommand()
- Me.radDock1.CommandManager.RegisterCommand(New FloatWindowCommand())
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
## Enable/Disable the Command Manager
diff --git a/controls/dock/architecture-and-features/using-the-contextmenuservice.md b/controls/dock/architecture-and-features/using-the-contextmenuservice.md
index 83cb77aee..bda9d7413 100644
--- a/controls/dock/architecture-and-features/using-the-contextmenuservice.md
+++ b/controls/dock/architecture-and-features/using-the-contextmenuservice.md
@@ -26,73 +26,19 @@ Let's get the **ContextMenuService** and subscribe to its **ContextMenuDisplayi
#### Getting the ContextMenuService
-{{source=..\SamplesCS\Dock\ArchitectureAndFeatures.cs region=gettingContextMenuService}}
-{{source=..\SamplesVB\Dock\ArchitectureAndFeatures.vb region=gettingContextMenuService}}
+
+
-````C#
-ContextMenuService menuService = this.radDock1.GetService();
-menuService.ContextMenuDisplaying += menuService_ContextMenuDisplaying;
-
-````
-````VB.NET
-Dim menuService As ContextMenuService = Me.RadDock1.GetService(Of ContextMenuService)()
-AddHandler menuService.ContextMenuDisplaying, AddressOf menuService_ContextMenuDisplaying
-
-````
-
-{{endregion}}
+
Then, hide the 'Close' options in the **ContextMenuDisplaying** event handler:
#### Hiding the 'close' menu items
-{{source=..\SamplesCS\Dock\ArchitectureAndFeatures.cs region=handlingContextMenuDisplaying}}
-{{source=..\SamplesVB\Dock\ArchitectureAndFeatures.vb region=handlingContextMenuDisplaying}}
-
-````C#
-private void menuService_ContextMenuDisplaying(object sender, ContextMenuDisplayingEventArgs e)
-{
- //the menu request is associated with a valid DockWindow instance, which resides within a DocumentTabStrip
- if (e.MenuType == ContextMenuType.DockWindow &&
- e.DockWindow.DockTabStrip is DocumentTabStrip)
- {
- //remove the "Close" menu items
- for (int i = 0; i < e.MenuItems.Count; i++)
- {
- RadMenuItemBase menuItem = e.MenuItems[i];
- if (menuItem.Name == "CloseWindow" ||
- menuItem.Name == "CloseAllButThis" ||
- menuItem.Name == "CloseAll" ||
- menuItem is RadMenuSeparatorItem)
- {
- // In case you just want to disable to option you can set Enabled false
- //menuItem.Enabled = false;
- menuItem.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
- }
- }
- }
-}
+
+
-````
-````VB.NET
-Private Sub menuService_ContextMenuDisplaying(ByVal sender As Object, ByVal e As ContextMenuDisplayingEventArgs)
- 'the menu request is associated with a valid DockWindow instance, which resides within a DocumentTabStrip
- If e.MenuType = ContextMenuType.DockWindow AndAlso TypeOf e.DockWindow.DockTabStrip Is DocumentTabStrip Then
- 'remove the "Close" menu items
- For i As Integer = 0 To e.MenuItems.Count - 1
- Dim menuItem As RadMenuItemBase = e.MenuItems(i)
- If menuItem.Name = "CloseWindow" OrElse menuItem.Name = "CloseAllButThis" OrElse menuItem.Name = "CloseAll" OrElse TypeOf menuItem Is RadMenuSeparatorItem Then
- ' In case you just want to disable to option you can set Enabled false
- 'menuItem.Enabled = false;
- menuItem.Visibility = Telerik.WinControls.ElementVisibility.Collapsed
- End If
- Next i
- End If
-End Sub
-
-````
-
-{{endregion}}
+
The result is shown on the screenshot below:
diff --git a/controls/dock/architecture-and-features/using-the-dragdropservice.md b/controls/dock/architecture-and-features/using-the-dragdropservice.md
index bd037c131..6d0c97800 100644
--- a/controls/dock/architecture-and-features/using-the-dragdropservice.md
+++ b/controls/dock/architecture-and-features/using-the-dragdropservice.md
@@ -20,21 +20,10 @@ A running drag-and-drop operation (DDO) may be easily canceled by either pressin
#### Canceling Drag-and-drop operation
-{{source=..\SamplesCS\Dock\ArchitectureAndFeatures.cs region=cancellingService}}
-{{source=..\SamplesVB\Dock\ArchitectureAndFeatures.vb region=cancellingService}}
+
+
-````C#
-DragDropService service = this.radDock1.GetService();
-service.Stop(false);
-
-````
-````VB.NET
-Dim service As DragDropService = Me.RadDock1.GetService(Of DragDropService)()
-service.Stop(False)
-
-````
-
-{{endregion}}
+
The Boolean parameter determines whether the operation should be committed (applied) or not.
@@ -46,19 +35,10 @@ You can switch between *Preview* and *Immediate* modes by setting the __DragDro
#### Setting DragDropMode
-{{source=..\SamplesCS\Dock\ArchitectureAndFeatures.cs region=dragDropMode}}
-{{source=..\SamplesVB\Dock\ArchitectureAndFeatures.vb region=dragDropMode}}
-
-````C#
-this.radDock1.DragDropMode = DragDropMode.Preview;
+
+
-````
-````VB.NET
-Me.RadDock1.DragDropMode = DragDropMode.Preview
-
-````
-
-{{endregion}}
+
## AllowedDockStates
@@ -66,21 +46,10 @@ The service may be told which dock states are allowed to be hit-tested. For exam
#### Setting AllowedStates
-{{source=..\SamplesCS\Dock\ArchitectureAndFeatures.cs region=dragDropAllowedStates}}
-{{source=..\SamplesVB\Dock\ArchitectureAndFeatures.vb region=dragDropAllowedStates}}
-
-````C#
-DragDropService service = this.radDock1.GetService();
-service.AllowedStates &= ~AllowedDockState.Floating;
+
+
-````
-````VB.NET
-Dim service As DragDropService = Me.RadDock1.GetService(Of DragDropService)()
-service.AllowedStates = service.AllowedStates And Not AllowedDockState.Floating
-
-````
-
-{{endregion}}
+
## Extending Service’s Behavior by Handling Events
@@ -104,39 +73,10 @@ The following example demonstrates how to allow only DockPosition.*Bottom* for t
#### Handling DragDropService events
-{{source=..\SamplesCS\Dock\ArchitectureAndFeatures.cs region=initDragDropEvents}}
-{{source=..\SamplesVB\Dock\ArchitectureAndFeatures.vb region=initDragDropEvents}}
-
-````C#
-private void InitDragDropEvents()
-{
- DragDropService service = this.radDock1.GetService();
- service.PreviewDockPosition += new DragDropDockPositionEventHandler(service_PreviewDockPosition);
-}
-
-private void service_PreviewDockPosition(object sender, DragDropDockPositionEventArgs e)
-{
- if (e.DropTarget == this.radDock1.MainDocumentContainer)
- {
- e.AllowedDockPosition = AllowedDockPosition.Bottom;
- }
-}
-
-````
-````VB.NET
-Private Sub InitDragDropEvents()
- Dim service As DragDropService = Me.RadDock1.GetService(Of DragDropService)()
- AddHandler service.PreviewDockPosition, AddressOf service_PreviewDockPosition
-End Sub
-Private Sub service_PreviewDockPosition(ByVal sender As Object, ByVal e As DragDropDockPositionEventArgs)
- If e.DropTarget Is Me.RadDock1.MainDocumentContainer Then
- e.AllowedDockPosition = AllowedDockPosition.Bottom
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
>caption Figure 1: Only DockPosition.Bottom is allowed.
@@ -148,26 +88,10 @@ The service may be told which edges of the owning **RadDock** instance are allow
#### Setting AllowedDockManagerEdges
-{{source=..\SamplesCS\Dock\ArchitectureAndFeatures.cs region=initDragDropProperties}}
-{{source=..\SamplesVB\Dock\ArchitectureAndFeatures.vb region=initDragDropProperties}}
+
+
-````C#
-private void InitDragDropProperties()
-{
- DragDropService service = this.radDock1.GetService();
- service.AllowedDockManagerEdges = AllowedDockPosition.Left | AllowedDockPosition.Right;
-}
-
-````
-````VB.NET
-Private Sub InitDragDropProperties()
- Dim service As DragDropService = Me.RadDock1.GetService(Of DragDropService)()
- service.AllowedDockManagerEdges = AllowedDockPosition.Left Or AllowedDockPosition.Right
-End Sub
-
-````
-
-{{endregion}}
+
>caption Figure 2: Only DockPosition.Left and DockPosition.Right are available.
diff --git a/controls/dock/architecture-and-features/using-the-redockservice.md b/controls/dock/architecture-and-features/using-the-redockservice.md
index 651d70ffb..e5b1d5806 100644
--- a/controls/dock/architecture-and-features/using-the-redockservice.md
+++ b/controls/dock/architecture-and-features/using-the-redockservice.md
@@ -25,36 +25,10 @@ Let's take a look at the following scenario:
1. Now comes the time when the user wants to re-dock the floating **ToolWindows**. However, the user does not only want to dock the **ToolWindows**, he/she want to achieve the layout that he/she had at the beginning. For that purpose, we can have a button or a menu item on the **Click** of which we get the **RedockService** and return the floating windows to their original docked state by calling the __RestoreMethod__ of the service. When the user clicks that button, he/she will get the layout below, which as you can see is the same as the layout that we had at the beginning:
-{{source=..\SamplesCS\Dock\UsingTheRedockService.cs region=redockService}}
-{{source=..\SamplesVB\Dock\UsingTheRedockService.vb region=redockService}}
+
+
-````C#
-void radButton1_Click(object sender, EventArgs e)
-{
- RedockService service = this.radDock1.GetService();
- foreach (DockWindow window in this.radDock1.DockWindows)
- {
- if (window.DockState == DockState.Floating)
- {
- service.RestoreState(window, DockState.Docked, true);
- }
- }
-}
-
-````
-````VB.NET
-Private Sub radButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
- Dim service As RedockService = Me.RadDock1.GetService(Of RedockService)()
- For Each window As DockWindow In Me.RadDock1.DockWindows
- If window.DockState = DockState.Floating Then
- service.RestoreState(window, DockState.Docked, True)
- End If
- Next window
-End Sub
-
-````
-
-{{endregion}}
+

diff --git a/controls/dock/docking-usercontrols-and-forms/docking-a-usercontrol-with-custom-event.md b/controls/dock/docking-usercontrols-and-forms/docking-a-usercontrol-with-custom-event.md
index a1d9ca2cc..a0eb7ca61 100644
--- a/controls/dock/docking-usercontrols-and-forms/docking-a-usercontrol-with-custom-event.md
+++ b/controls/dock/docking-usercontrols-and-forms/docking-a-usercontrol-with-custom-event.md
@@ -35,47 +35,19 @@ In our particular case we dock a user control instance inside a __RadDock__ inst
#### Setting up DateChanged Event
-{{source=..\SamplesCS\Dock\CalendarPanel.cs region=definingDelegates}}
-{{source=..\SamplesVB\Dock\CalendarPanel.vb region=definingDelegates}}
+
+
-````C#
-public delegate void DateChangedHandler(DateTime date);
-public event DateChangedHandler DateChanged;
-
-````
-````VB.NET
-Public Delegate Sub DateChangedHandler(ByVal [date] As DateTime)
-Public Event DateChanged As DateChangedHandler
-
-````
-
-{{endregion}}
+
In the __SelectionChanged__ event handler add the following code:
#### Handling the RadCalendar SelectionChanged event
-{{source=..\SamplesCS\Dock\CalendarPanel.cs region=handlingSelectionChanged}}
-{{source=..\SamplesVB\Dock\CalendarPanel.vb region=handlingSelectionChanged}}
+
+
-````C#
-private void radCalendar1_SelectionChanged(object sender, EventArgs e)
-{
- if (DateChanged != null)
- {
- DateChanged((sender as Telerik.WinControls.UI.RadCalendar).SelectedDate);
- }
-}
-
-````
-````VB.NET
-Private Sub RadCalendar1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadCalendar1.SelectionChanged
- RaiseEvent DateChanged((TryCast(sender, RadCalendar)).SelectedDate)
-End Sub
-
-````
-
-{{endregion}}
+
7\. In the Solution Explorer, double-click the main form to open its design surface.
@@ -85,48 +57,19 @@ End Sub
#### Docking CalendarPanel user control in RadDock
-{{source=..\SamplesCS\Dock\DockingForms.cs region=creatingCalendarPanel}}
-{{source=..\SamplesVB\Dock\DockingForms.vb region=creatingCalendarPanel}}
-
-````C#
-CalendarPanel calendarPanel = new CalendarPanel();
-HostWindow host = this.radDock1.DockControl(calendarPanel, Telerik.WinControls.UI.Docking.DockPosition.Left);
-host.Text = "Calendar";
-calendarPanel.DateChanged += calendarPanel_DateChanged;
-
-````
-````VB.NET
-Dim calendarPanel As New CalendarPanel()
-Dim host As HostWindow = Me.RadDock1.DockControl(calendarPanel, Telerik.WinControls.UI.Docking.DockPosition.Left)
-host.Text = "Calendar"
-AddHandler calendarPanel.DateChanged, AddressOf calendarPanel_DateChanged
-
-````
-
-{{endregion}}
+
+
+
+
10\. Add an event handler for the CalendarPanel **DateChanged** event:
#### Handling the Custom DateChanged event
-{{source=..\SamplesCS\Dock\DockingForms.cs region=handlingDateChanged}}
-{{source=..\SamplesVB\Dock\DockingForms.vb region=handlingDateChanged}}
-
-````C#
-void calendarPanel_DateChanged(DateTime date)
-{
- RadMessageBox.Show("Selected date is: " + date.ToShortDateString());
-}
+
+
-````
-````VB.NET
-Sub calendarPanel_DateChanged(ByVal [date] As DateTime)
- RadMessageBox.Show("Selected date is: " + [date].ToShortDateString())
-End Sub
-
-````
-
-{{endregion}}
+
11\. Press __F5__ to run the application. Click the cells in the calendar to display the date in a message dialog.
diff --git a/controls/dock/docking-usercontrols-and-forms/docking-singleton-forms.md b/controls/dock/docking-usercontrols-and-forms/docking-singleton-forms.md
index e60ba2441..30e1bdf7a 100644
--- a/controls/dock/docking-usercontrols-and-forms/docking-singleton-forms.md
+++ b/controls/dock/docking-usercontrols-and-forms/docking-singleton-forms.md
@@ -27,111 +27,17 @@ Here is how to do that:
1\. For each of the types of forms that we create, we should create a corresponding **DocumentWindow**/**ToolWindow** that serves as a container. Initially, global variables for the **DocumentWindows**/**ToolWindows** should be defined without creating new objects.
-{{source=..\SamplesCS\Dock\SingletonForms.cs region=fields}}
-{{source=..\SamplesVB\Dock\SingletonForms.vb region=fields}}
+
+
-````C#
-DocumentWindow greenDockWindow;
-DocumentWindow yellowDockWindow;
-
-````
-````VB.NET
-Private greenDockWindow As DocumentWindow
-Private yellowDockWindow As DocumentWindow
-
-````
-
-{{endregion}}
+
2\. Upon clicking a button for opening a specific type of form, we should check if an object of the appropriate **DocumentWindow** exists. If it does not exist, this means that a form of the type that matches the **DocumentWindow** has never been created, so we need to create such a form together with the **DocumentWindow**. Note that we set the __CloseAction__ of the **DocumentWindow** to *Hide*. When the end-user closes the **DocumentWindow**, it actually becomes hidden rather than closed and disposed. This allows us to use the same instance later. After creating the form and the window, we should dock the form in the window - this will allow us to control the form together with the **DocumentWindow** that hosts it using the globally defined **DocumentWindow** variables. Finally, we should just show the **DocumentWindow**. If the **DocumentWindow** has already been created the previous time we pressed the 'show' button, we should just show it:
-{{source=..\SamplesCS\Dock\SingletonForms.cs region=clickHandlers}}
-{{source=..\SamplesVB\Dock\SingletonForms.vb region=clickHandlers}}
+
+
-````C#
-private void btnOpenGreenForm_Click(object sender, EventArgs e)
-{
- if (greenDockWindow == null)
- {
- greenDockWindow = new DocumentWindow();
- greenDockWindow.Text = "Green Form";
- greenDockWindow.CloseAction = DockWindowCloseAction.Hide;
- GreenForm gForm = new GreenForm();
- gForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- gForm.TopLevel = false;
- gForm.Dock = DockStyle.Fill;
- greenDockWindow.Controls.Add(gForm);
- this.radDock1.AddDocument(greenDockWindow);
- gForm.Show();
- }
- else
- {
- greenDockWindow.Show();
- }
- this.radDock1.ActiveWindow = greenDockWindow;
-}
-private void btnOpenYellowForm_Click(object sender, EventArgs e)
-{
- if (yellowDockWindow == null)
- {
- yellowDockWindow = new DocumentWindow();
- yellowDockWindow.Text = "Yellow Form";
- yellowDockWindow.CloseAction = DockWindowCloseAction.Hide;
- YellowForm yForm = new YellowForm();
- yForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- yForm.TopLevel = false;
- yForm.Dock = DockStyle.Fill;
- yellowDockWindow.Controls.Add(yForm);
- this.radDock1.AddDocument(yellowDockWindow);
- yForm.Show();
- }
- else
- {
- yellowDockWindow.Show();
- }
- this.radDock1.ActiveWindow = yellowDockWindow;
-}
-
-````
-````VB.NET
-Private Sub btnOpenGreenForm_Click(ByVal sender As Object, ByVal e As EventArgs)
- If greenDockWindow Is Nothing Then
- greenDockWindow = New DocumentWindow()
- greenDockWindow.Text = "Green Form"
- greenDockWindow.CloseAction = DockWindowCloseAction.Hide
- Dim gForm As New GreenForm()
- gForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
- gForm.TopLevel = False
- gForm.Dock = DockStyle.Fill
- greenDockWindow.Controls.Add(gForm)
- Me.RadDock1.AddDocument(greenDockWindow)
- gForm.Show()
- Else
- greenDockWindow.Show()
- End If
- Me.RadDock1.ActiveWindow = greenDockWindow
-End Sub
-Private Sub btnOpenYellowForm_Click(ByVal sender As Object, ByVal e As EventArgs)
- If yellowDockWindow Is Nothing Then
- yellowDockWindow = New DocumentWindow()
- yellowDockWindow.Text = "Yellow Form"
- yellowDockWindow.CloseAction = DockWindowCloseAction.Hide
- Dim yForm As New YellowForm()
- yForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
- yForm.TopLevel = False
- yForm.Dock = DockStyle.Fill
- yellowDockWindow.Controls.Add(yForm)
- Me.RadDock1.AddDocument(yellowDockWindow)
- yForm.Show()
- Else
- yellowDockWindow.Show()
- End If
- Me.RadDock1.ActiveWindow = yellowDockWindow
-End Sub
-
-````
-
-{{endregion}}
+
# See Also
diff --git a/controls/dock/docking-usercontrols-and-forms/get-a-hostwindow-by-its-content.md b/controls/dock/docking-usercontrols-and-forms/get-a-hostwindow-by-its-content.md
index dbd4bcc7c..c89330386 100644
--- a/controls/dock/docking-usercontrols-and-forms/get-a-hostwindow-by-its-content.md
+++ b/controls/dock/docking-usercontrols-and-forms/get-a-hostwindow-by-its-content.md
@@ -15,54 +15,19 @@ In certain cases, you may need to perform specific operations depending on the
In order to do this, you should first subscribe to the **ActiveWindowChanged** event and then execute the following code snippet in the **ActiveWindowChanged** event handler:
-{{source=..\SamplesCS\Dock\DockingForms.cs region=handlingActiveWindowChanged}}
-{{source=..\SamplesVB\Dock\DockingForms.vb region=handlingActiveWindowChanged}}
+
+
-````C#
-void radDock1_ActiveWindowChanged(object sender, Telerik.WinControls.UI.Docking.DockWindowEventArgs e)
-{
- HostWindow hostWin = e.DockWindow as HostWindow;
- if (hostWin != null)
- {
- if (hostWin.Content is VegetablesForm)
- {
- // custom implementation here
- }
- }
-}
-
-````
-````VB.NET
-Private Sub radDock1_ActiveWindowChanged(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.Docking.DockWindowEventArgs)
- Dim hostWin As HostWindow = TryCast(e.DockWindow, HostWindow)
- If Not hostWin Is Nothing Then
- If TypeOf hostWin.Content Is VegetablesForm Then
- ' custom implementation here
- End If
- End If
-End Sub
-
-````
-
-{{endregion}}
+
## Getting a HostWindow by its content
In order to get a **HostWindow** that hosts a particular form/user control instance, you should call the __GetHostWindows__ method passing the contained control as a parameter. Supposing that `vegetablesForm` is an instance of type **VegetablesForm**, we can use the following code snippet:
-{{source=..\SamplesCS\Dock\DockingForms.cs region=gettingWindow}}
-{{source=..\SamplesVB\Dock\DockingForms.vb region=gettingWindow}}
-
-````C#
-HostWindow vegetablesWindow = this.radDock1.GetHostWindow(vegetablesForm);
-
-````
-````VB.NET
-Dim vegetablesWindow As HostWindow = Me.RadDock1.GetHostWindow(VegetablesForm)
-
-````
+
+
-{{endregion}}
+
# See Also
diff --git a/controls/dock/docking-usercontrols-and-forms/getting-started.md b/controls/dock/docking-usercontrols-and-forms/getting-started.md
index 04696144f..51c23bf1e 100644
--- a/controls/dock/docking-usercontrols-and-forms/getting-started.md
+++ b/controls/dock/docking-usercontrols-and-forms/getting-started.md
@@ -17,27 +17,10 @@ For example, the following code snippet will result in the screenshot shown belo
#### Docking a Form
-{{source=..\SamplesCS\Dock\DockingForms.cs region=dockingForm}}
-{{source=..\SamplesVB\Dock\DockingForms.vb region=dockingForm}}
-
-````C#
-Form form = new Form();
-form.BackColor = Color.Pink;
-form.Text = "My Form";
-this.radDock1.DockControl(form, DockPosition.Left);
-form.Show();
-
-````
-````VB.NET
-Dim form As Form = New Form()
-form.BackColor = Color.Pink
-form.Text = "My Form"
-Me.RadDock1.DockControl(form, DockPosition.Left)
-form.Show()
-
-````
-
-{{endregion}}
+
+
+
+

diff --git a/controls/dock/getting-started.md b/controls/dock/getting-started.md
index c2635da40..204023dd5 100644
--- a/controls/dock/getting-started.md
+++ b/controls/dock/getting-started.md
@@ -86,101 +86,28 @@ For more complex scenarios the advanced layout designer provides full drag and d
#### Include namespaces
-{{source=..\SamplesCS\Dock\GettingStarted.cs region=namespace}}
-{{source=..\SamplesVB\Dock\GettingStarted.vb region=namespace}}
+
+
-````C#
-using Telerik.WinControls.UI;
-using Telerik.WinControls.UI.Docking;
-
-````
-````VB.NET
-Imports Telerik.WinControls.UI
-Imports Telerik.WinControls.UI.Docking
-
-````
-
-{{endregion}}
+
15\. Create a Form.__Load__ event handler and copy the code below to it. This code builds the __TreeView__ node structure and links the __Name__ of each __DocumentWindow__ to the corresponding Node.__Tag__ property. Each dockable object has a __Name__ property, a __String__ that uniquely identifies it. Later, we use the __Name__ to locate the __DocumentWindow__ and activate it.
#### Initializing RadTreeView
-{{source=..\SamplesCS\Dock\GettingStarted.cs region=settingUpTree}}
-{{source=..\SamplesVB\Dock\GettingStarted.vb region=settingUpTree}}
-
-````C#
-void Form1_Load(object sender, EventArgs e)
-{
- RadTreeNode productNode = radTreeView1.Nodes.Add("Product Reports");
- RadTreeNode customerNode = radTreeView1.Nodes.Add("Customer Reports");
- RadTreeNode productListingNode = new RadTreeNode("Product Listing");
- productListingNode.Tag = dwProductListing.Name;
- RadTreeNode productCategoryNode = new RadTreeNode("Product By Category");
- productCategoryNode.Tag = dwProductByCategory.Name;
- RadTreeNode top10CustomerNode = new RadTreeNode("Top 10 Customers");
- top10CustomerNode.Tag = dwTop10Customers.Name;
- productNode.Nodes.Add(productListingNode);
- productNode.Nodes.Add(productCategoryNode);
- customerNode.Nodes.Add(top10CustomerNode);
- radTreeView1.ExpandAll();
-}
-
-````
-````VB.NET
-Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Dim productNode As RadTreeNode = RadTreeView1.Nodes.Add("Product Reports")
- Dim customerNode As RadTreeNode = RadTreeView1.Nodes.Add("Customer Reports")
- Dim productListingNode As New RadTreeNode("Product Listing")
- productListingNode.Tag = dwProductListing.Name
- Dim productCategoryNode As New RadTreeNode("Product By Category")
- productCategoryNode.Tag = dwProductByCategory.Name
- Dim top10CustomerNode As New RadTreeNode("Top 10 Customers")
- top10CustomerNode.Tag = dwTop10Customers.Name
- productNode.Nodes.Add(productListingNode)
- productNode.Nodes.Add(productCategoryNode)
- customerNode.Nodes.Add(top10CustomerNode)
- RadTreeView1.ExpandAll()
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
16\. Create a __SelectedNodeChanged__ event handler and add the following code to it. The code for this event handler verifies that the __Tag__ of the selected node has a value. Further, if this value corresponds to the name of an existing window in __RadDock__, the appropriate **DocumentWindow** gets activated.
#### Handling the RadTreeView SelectedNodeChanged event
-{{source=..\SamplesCS\Dock\GettingStarted.cs region=handlingSelectedNodeChanged}}
-{{source=..\SamplesVB\Dock\GettingStarted.vb region=handlingSelectedNodeChanged}}
-
-````C#
-void radTreeView1_SelectedNodeChanged(object sender, RadTreeViewEventArgs e)
-{
- if (e.Node.Tag != null)
- {
- DockWindow dw = this.radDock1[e.Node.Tag.ToString()];
- if (dw != null)
- {
- this.radDock1.ActiveWindow = dw;
- }
- }
-}
-
-````
-````VB.NET
-Private Sub RadTreeView1_SelectedNodeChanged(ByVal sender As Object, ByVal e As RadTreeViewEventArgs)
- If Not e.Node.Tag Is Nothing Then
- Dim dw As DockWindow = Me.RadDock1(e.Node.Tag.ToString())
- If Not dw Is Nothing Then
- Me.RadDock1.ActiveWindow = dw
- End If
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
Press __F5__ to run the application. Try experimenting with...
diff --git a/controls/dock/loading-and-saving-layouts/loading-and-saving-layouts.md b/controls/dock/loading-and-saving-layouts/loading-and-saving-layouts.md
index b223769aa..6b00124de 100644
--- a/controls/dock/loading-and-saving-layouts/loading-and-saving-layouts.md
+++ b/controls/dock/loading-and-saving-layouts/loading-and-saving-layouts.md
@@ -19,45 +19,17 @@ To save a layout, call the __RadDock.SaveToXML__ method:
#### SaveToXml
-{{source=..\SamplesCS\Dock\SaveLoadLayout.cs region=saveLayout}}
-{{source=..\SamplesVB\Dock\SaveLoadLayout.vb region=saveLayout}}
+
+
-````C#
-this.radDock1.SaveToXml("c:\\layout1.xml");
-
-````
-````VB.NET
-Me.RadDock1.SaveToXml("c:\layout1.xml")
-
-````
-
-{{endregion}}
+
You can use the __DockWindowSerializing__ event to exclude windows from the saved layout:
-{{source=..\SamplesCS\Dock\SaveLoadLayout.cs region=Serializing}}
-{{source=..\SamplesVB\Dock\SaveLoadLayout.vb region=Serializing}}
-
-````C#
-void radDock1_DockWindowSerializing(object sender, DockWindowCancelEventArgs e)
-{
- if (e.NewWindow.Text == "Window Top")
- {
- e.Cancel = true;
- }
-}
-
-````
-````VB.NET
-Private Sub radDock1_DockWindowSerializing(ByVal sender As Object, ByVal e As DockWindowCancelEventArgs)
- If e.NewWindow.Text = "Window Top" Then
- e.Cancel = True
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
## To Load a Layout
@@ -66,19 +38,10 @@ To load a layout, call the __RadDock.LoadFromXML__ method:
#### LoadFromXml
-{{source=..\SamplesCS\Dock\SaveLoadLayout.cs region=loadLayout}}
-{{source=..\SamplesVB\Dock\SaveLoadLayout.vb region=loadLayout}}
-
-````C#
-this.radDock1.LoadFromXml("c:\\layout1.xml");
-
-````
-````VB.NET
-Me.RadDock1.LoadFromXml("c:\layout1.xml")
+
+
-````
-
-{{endregion}}
+
>note With the introduction of the __R3 2023 SP1__ version of our controls, the __LoadFromXml()__ expose second (optional) parameter. This parameter provides the option to specify whether to remove all existing dock windows or not. By default, the second parameter is set to __false__.
diff --git a/controls/dock/loading-and-saving-layouts/tutorial-saving-and-loading-layout-and-content.md b/controls/dock/loading-and-saving-layouts/tutorial-saving-and-loading-layout-and-content.md
index 8b9a55d7a..f1f8f841c 100644
--- a/controls/dock/loading-and-saving-layouts/tutorial-saving-and-loading-layout-and-content.md
+++ b/controls/dock/loading-and-saving-layouts/tutorial-saving-and-loading-layout-and-content.md
@@ -28,72 +28,17 @@ As stated in [this documentation article]({%slug winforms/dock/loading-and-savin
2\. Then, let's define the path to the xml file where we will save our layout:
-{{source=..\SamplesCS\Dock\SaveLoadLayout.cs region=paths}}
-{{source=..\SamplesVB\Dock\SaveLoadLayout.vb region=paths}}
+
+
-````C#
-private string dockLayoutPath = Application.StartupPath + "\\dock.xml";
-
-````
-````VB.NET
-Private dockLayoutPath As String = Application.StartupPath & "\dock.xml"
-
-````
-
-{{endregion}}
+
3\. At the **Load** event of our form we will check if the xml file with the saved layout exists. If the file exists at the specified location, we will load the layout as shown in the next paragraphs. If it does not exists, we will create a generic layout in **RadDock** loading our user controls:
-{{source=..\SamplesCS\Dock\SaveLoadLayout.cs region=formLoad}}
-{{source=..\SamplesVB\Dock\SaveLoadLayout.vb region=formLoad}}
-
-````C#
-private void MainForm_Load(object sender, EventArgs e)
-{
- if (!File.Exists(dockLayoutPath))
- {
- InitializeLayout();
- }
- else
- {
- this.radDock1.LoadFromXml(dockLayoutPath);
- LoadContent();
- }
-}
-private void InitializeLayout()
-{
- this.radDock1.MainDocumentContainerVisible = false;
- HostWindow afW = this.radDock1.DockControl(new AvailableFlights(), DockPosition.Left);
- afW.Text = "Available Flights";
- HostWindow bfW = this.radDock1.DockControl(new BookFlight(), DockPosition.Left);
- bfW.Text = "Book a Flight";
- HostWindow fsW = this.radDock1.DockControl(new FlightsSummary(), DockPosition.Left);
- fsW.Text = "Flight Summary";
-}
-
-````
-````VB.NET
-Private Sub MainForm_Load(ByVal sender As Object, ByVal e As EventArgs)
- If Not File.Exists(dockLayoutPath) Then
- InitializeLayout()
- Else
- Me.RadDock1.LoadFromXml(dockLayoutPath)
- LoadContent()
- End If
-End Sub
-Private Sub InitializeLayout()
- Me.RadDock1.MainDocumentContainerVisible = False
- Dim afW As HostWindow = Me.RadDock1.DockControl(New AvailableFlights(), DockPosition.Left)
- afW.Text = "Available Flights"
- Dim bfW As HostWindow = Me.RadDock1.DockControl(New BookFlight(), DockPosition.Left)
- bfW.Text = "Book a Flight"
- Dim fsW As HostWindow = Me.RadDock1.DockControl(New FlightsSummary(), DockPosition.Left)
- fsW.Text = "Flight Summary"
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
Please note that the names of the types of the **UserControls** are important, because these names will actually give the names of the **HostWindows** that will be created to host the **UserControls**. The names of the **HostWindows** will be later used during the process of loading the content.
@@ -105,24 +50,10 @@ Please note that the names of the types of the **UserControls** are important, b
5\. Now close the form containing RadDock. The **FormClosing** event handler is a convenient place to save our layout:
-{{source=..\SamplesCS\Dock\SaveLoadLayout.cs region=formClosing}}
-{{source=..\SamplesVB\Dock\SaveLoadLayout.vb region=formClosing}}
+
+
-````C#
-private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
-{
- this.radDock1.SaveToXml(dockLayoutPath);
-}
-
-````
-````VB.NET
-Private Sub MainForm_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs)
- Me.RadDock1.SaveToXml(dockLayoutPath)
-End Sub
-
-````
-
-{{endregion}}
+
6\. Reopen the form. Since the XML file defined at paragraph two now exists, our layout and content will be loaded with the help of the following methods:
@@ -130,61 +61,10 @@ End Sub
* __LoadContent:__ This is our custom method which loads the content in the created **HostWindows**. Note that the different user controls are loaded in the appropriate **HostWindows** depending on the names of these windows.
-{{source=..\SamplesCS\Dock\SaveLoadLayout.cs region=loadContent}}
-{{source=..\SamplesVB\Dock\SaveLoadLayout.vb region=loadContent}}
-
-````C#
-private void LoadContent()
-{
- for (int i = 0; i < this.radDock1.DockWindows.Count; i++)
- {
- HostWindow hw = this.radDock1.DockWindows[i] as HostWindow;
- if (hw != null)
- {
- if (hw.Name.StartsWith("Available"))
- {
- hw.LoadContent(new AvailableFlights());
- hw.Text = "Available Flights";
- }
- if (hw.Name.StartsWith("Book"))
- {
- hw.LoadContent(new BookFlight());
- hw.Text = "Book a Flight";
- }
- if (hw.Name.StartsWith("Flight"))
- {
- hw.LoadContent(new FlightsSummary());
- hw.Text = "Flight Summary";
- }
- }
- }
-}
-
-````
-````VB.NET
-Private Sub LoadContent()
- For i As Integer = 0 To Me.RadDock1.DockWindows.Count - 1
- Dim hw As HostWindow = TryCast(Me.RadDock1.DockWindows(i), HostWindow)
- If hw IsNot Nothing Then
- If hw.Name.StartsWith("Available") Then
- hw.LoadContent(New AvailableFlights())
- hw.Text = "Available Flights"
- End If
- If hw.Name.StartsWith("Book") Then
- hw.LoadContent(New BookFlight())
- hw.Text = "Book a Flight"
- End If
- If hw.Name.StartsWith("Flight") Then
- hw.LoadContent(New FlightsSummary())
- hw.Text = "Flight Summary"
- End If
- End If
- Next i
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
As a result we get the layout shown on the screenshot below:
diff --git a/controls/dock/localization/localization.md b/controls/dock/localization/localization.md
index f1b071a79..596771f82 100644
--- a/controls/dock/localization/localization.md
+++ b/controls/dock/localization/localization.md
@@ -1,156 +1,46 @@
----
-title: Localization
-page_title: Localization - WinForms Dock Control
-description: Learn how you can localize the strings used in WinForms RadDock.
-slug: winforms/dock/localization/localization
-tags: localization
-published: True
-position: 0
-previous_url: dock-localization
----
-
-# Localization
-
-To localize __RadDock__ to display control text and messages in a specific language:
-
-* All required classes for localization are defined in __Telerik.WinControls.UI.Localization__ namespace.
-
-* Start by creating a descendant of the **RadDockLocalizationProvider** class.
-
-* Override the __GetLocalizedString(string id)__ method and provide a translation for the label and user messages. If a translation is not provided, the default value will be returned. This behavior is guaranteed by the call to the base __GetLocalizedString__ method in the __default__ clause of the switch statement in the example.
-
-Below is a sample implementation of a custom localization provider, which returns translations of the default values in English:
-
-#### Localizing RadDock Strings
-
-{{source=..\SamplesCS\Dock\CustomDockProvider.cs region=customProvider}}
-{{source=..\SamplesVB\Dock\CustomDockProvider.vb region=customProvider}}
-
-````C#
-public class EnglishDockLocalizationProvider : RadDockLocalizationProvider
-{
- public override string GetLocalizedString(string id)
- {
- switch (id)
- {
- case RadDockStringId.ContextMenuFloating:
- return "Floating";
- case RadDockStringId.ContextMenuDockable:
- return "Dockable";
- case RadDockStringId.ContextMenuTabbedDocument:
- return "Tabbed Document";
- case RadDockStringId.ContextMenuAutoHide:
- return "Auto Hide";
- case RadDockStringId.ContextMenuHide:
- return "Hide";
- case RadDockStringId.ContextMenuClose:
- return "Close";
- case RadDockStringId.ContextMenuCloseAll:
- return "Close All";
- case RadDockStringId.ContextMenuCloseAllButThis:
- return "Close All But This";
- case RadDockStringId.ContextMenuMoveToPreviousTabGroup:
- return "Move to Previous Tab Group";
- case RadDockStringId.ContextMenuMoveToNextTabGroup:
- return "Move to Next Tab Group";
- case RadDockStringId.ContextMenuNewHorizontalTabGroup:
- return "New Horizontal Tab Group";
- case RadDockStringId.ContextMenuNewVerticalTabGroup:
- return "New Vertical Tab Group";
- case RadDockStringId.ToolTabStripCloseButton:
- return "Close Window";
- case RadDockStringId.ToolTabStripDockStateButton:
- return "Window State";
- case RadDockStringId.ToolTabStripUnpinButton:
- return "Auto Hide";
- case RadDockStringId.ToolTabStripPinButton:
- return "Docked";
- case RadDockStringId.DocumentTabStripCloseButton:
- return "Close Document";
- case RadDockStringId.DocumentTabStripListButton:
- return "Active Documents";
- case RadDockStringId.ContextMenuCloseAllButPinned:
- return "Close All but Pinned";
- }
- return string.Empty;
- }
-}
-
-````
-````VB.NET
-Public Class EnglishDockLocalizationProvider
- Inherits RadDockLocalizationProvider
- Public Overrides Function GetLocalizedString(ByVal id As String) As String
- Select Case id
- Case RadDockStringId.ContextMenuFloating
- Return "Floating"
- Case RadDockStringId.ContextMenuDockable
- Return "Dockable"
- Case RadDockStringId.ContextMenuTabbedDocument
- Return "Tabbed Document"
- Case RadDockStringId.ContextMenuAutoHide
- Return "Auto Hide"
- Case RadDockStringId.ContextMenuHide
- Return "Hide"
- Case RadDockStringId.ContextMenuClose
- Return "Close"
- Case RadDockStringId.ContextMenuCloseAll
- Return "Close All"
- Case RadDockStringId.ContextMenuCloseAllButThis
- Return "Close All But This"
- Case RadDockStringId.ContextMenuMoveToPreviousTabGroup
- Return "Move to Previous Tab Group"
- Case RadDockStringId.ContextMenuMoveToNextTabGroup
- Return "Move to Next Tab Group"
- Case RadDockStringId.ContextMenuNewHorizontalTabGroup
- Return "New Horizontal Tab Group"
- Case RadDockStringId.ContextMenuNewVerticalTabGroup
- Return "New Vertical Tab Group"
- Case RadDockStringId.ToolTabStripCloseButton
- Return "Close Window"
- Case RadDockStringId.ToolTabStripDockStateButton
- Return "Window State"
- Case RadDockStringId.ToolTabStripUnpinButton
- Return "Auto Hide"
- Case RadDockStringId.ToolTabStripPinButton
- Return "Docked"
- Case RadDockStringId.DocumentTabStripCloseButton
- Return "Close Document"
- Case RadDockStringId.DocumentTabStripListButton
- Return "Active Documents"
- Case RadDockStringId.ContextMenuCloseAllButPinned
- Return "Close All but Pinned"
- End Select
- Return String.Empty
- End Function
-End Class
-
-````
-
-{{endregion}}
-
-
-To apply the custom localization provider, instantiate and assign it to the current localization provider:
-
-#### Localizing RadDock Strings
-
-{{source=..\SamplesCS\Dock\CustomDockProvider.cs region=settingCustomProvider}}
-{{source=..\SamplesVB\Dock\CustomDockProvider.vb region=settingCustomProvider}}
-
-````C#
-RadDockLocalizationProvider.CurrentProvider = new EnglishDockLocalizationProvider();
-
-````
-````VB.NET
-RadDockLocalizationProvider.CurrentProvider = New EnglishDockLocalizationProvider()
-
-````
-
-{{endregion}}
-
-
-The code provided above illustrates the approach to be used to localize the __RadDock__ and is not intended as a full translation.
-
-# See Also
-
-* [Right-to-left support]({%slug winforms/dock/localization/right-to-left-support%})
+---
+title: Localization
+page_title: Localization - WinForms Dock Control
+description: Learn how you can localize the strings used in WinForms RadDock.
+slug: winforms/dock/localization/localization
+tags: localization
+published: True
+position: 0
+previous_url: dock-localization
+---
+
+# Localization
+
+To localize __RadDock__ to display control text and messages in a specific language:
+
+* All required classes for localization are defined in __Telerik.WinControls.UI.Localization__ namespace.
+
+* Start by creating a descendant of the **RadDockLocalizationProvider** class.
+
+* Override the __GetLocalizedString(string id)__ method and provide a translation for the label and user messages. If a translation is not provided, the default value will be returned. This behavior is guaranteed by the call to the base __GetLocalizedString__ method in the __default__ clause of the switch statement in the example.
+
+Below is a sample implementation of a custom localization provider, which returns translations of the default values in English:
+
+#### Localizing RadDock Strings
+
+
+
+
+
+
+
+To apply the custom localization provider, instantiate and assign it to the current localization provider:
+
+#### Localizing RadDock Strings
+
+
+
+
+
+
+
+The code provided above illustrates the approach to be used to localize the __RadDock__ and is not intended as a full translation.
+
+# See Also
+
+* [Right-to-left support]({%slug winforms/dock/localization/right-to-left-support%})
diff --git a/controls/dock/localization/right-to-left-support.md b/controls/dock/localization/right-to-left-support.md
index 11a0c43c9..25773a35b 100644
--- a/controls/dock/localization/right-to-left-support.md
+++ b/controls/dock/localization/right-to-left-support.md
@@ -13,19 +13,10 @@ previous_url: dock-localization-rtl
You can present the content of your dock instance in a right-to-left direction by setting the __RightToLeft__ property to *Yes*:
-{{source=..\SamplesCS\Dock\CustomDockProvider.cs region=rtl}}
-{{source=..\SamplesVB\Dock\CustomDockProvider.vb region=rtl}}
+
+
-````C#
-radDock1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
-
-````
-````VB.NET
-Me.radDock1.RightToLeft = System.Windows.Forms.RightToLeft.Yes
-
-````
-
-{{endregion}}
+

diff --git a/controls/dock/mdi-mode/automatic-mdi-form-handling.md b/controls/dock/mdi-mode/automatic-mdi-form-handling.md
index a8f4c0233..0e29e4972 100644
--- a/controls/dock/mdi-mode/automatic-mdi-form-handling.md
+++ b/controls/dock/mdi-mode/automatic-mdi-form-handling.md
@@ -24,56 +24,20 @@ To configure your MDI application to use this feature:
#### Configuring the Parent Form
-{{source=..\SamplesCS\Dock\MDIHandling1.cs region=initialization}}
-{{source=..\SamplesVB\Dock\MDIHandling1.vb region=initialization}}
-
-````C#
-private void Form1_Load(object sender, EventArgs e)
-{
- this.IsMdiContainer = true;
- this.radDock1.AutoDetectMdiChildren = true;
-}
-
-````
-````VB.NET
-Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Me.IsMdiContainer = True
- Me.RadDock1.AutoDetectMdiChildren = True
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
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.
4\. Add code to the parent form to create the child form and assign it an MDI parent:
-{{source=..\SamplesCS\Dock\MDIHandling1.cs region=creatingChildForm}}
-{{source=..\SamplesVB\Dock\MDIHandling1.vb region=creatingChildForm}}
-
-````C#
-private void radMenuItem1_Click(object sender, EventArgs e)
-{
- Form childForm = new Form();
- childForm.Text = "MDI Child " + DateTime.Now.ToShortTimeString();
- childForm.MdiParent = this;
- childForm.Show();
-}
-
-````
-````VB.NET
-Private Sub RadMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadMenuItem1.Click
- Dim childForm As New Form()
- childForm.Text = "MDI Child " & DateTime.Now.ToShortTimeString()
- childForm.MdiParent = Me
- childForm.Show()
-End Sub
-
-````
+
+
-{{endregion}}
+
## MdiChildrenDockType
@@ -83,19 +47,10 @@ However, you can set the default type to **ToolWindow**:
#### Setting the default DockWindow type for MDI children forms
-{{source=..\SamplesCS\Dock\MDIHandling1.cs region=mdiChildrenDockType}}
-{{source=..\SamplesVB\Dock\MDIHandling1.vb region=mdiChildrenDockType}}
+
+
-````C#
-this.radDock1.MdiChildrenDockType = DockType.ToolWindow;
-
-````
-````VB.NET
-Me.RadDock1.MdiChildrenDockType = DockType.ToolWindow
-
-````
-
-{{endregion}}
+
When initially created, these **ToolWindows** look like **DocumentWindows**. This is just because their state is Tabbed Document. However, their real identity is **ToolWindow** - i.e. these windows can be docked, auto-hidden and floated.
@@ -120,28 +75,10 @@ This chain of events allows you to encapsulate all your business logic in the re
The __CloseAllWindows__ returns a bool value which indicates if the operation is successful (it will return *true* if all child windows are closed). This is allowing you to keep the main form opened if some of the MDI children cannot be closed for the moment. You can use the method as follows:
#### Using the CloseAllWindows method.
-{{source=..\SamplesCS\Dock\MDIHandling1.cs region=closing}}
-{{source=..\SamplesVB\Dock\MDIHandling1.vb region=closing}}
-
-````C#
-protected override void OnClosing(CancelEventArgs e)
-{
- bool canClose = radDock1.CloseAllWindows();
- e.Cancel = !canClose;
- base.OnClosing(e);
-}
-
-````
-````VB.NET
-Protected Overrides Sub OnClosing(ByVal e As CancelEventArgs)
- Dim canClose As Boolean = RadDock1.CloseAllWindows()
- e.Cancel = Not canClose
- MyBase.OnClosing(e)
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
## Using Singleton forms in MDI scenario with RadDock
diff --git a/controls/dock/object-model/accessing-dockwindows.md b/controls/dock/object-model/accessing-dockwindows.md
index 4196d41ad..bae2edef0 100644
--- a/controls/dock/object-model/accessing-dockwindows.md
+++ b/controls/dock/object-model/accessing-dockwindows.md
@@ -19,39 +19,17 @@ The __DockWindows__ property returns an array of all **DockWindow** in a __RadDo
* __GetWindows(DockState state):__ Returns an array of **DockWindows** that are put in a specific **DockState**. For example, the following code snippet will return an array of **DockWindows** that are currently hidden:
-{{source=..\SamplesCS\Dock\CreatingWindows.cs region=gettingHiddenWindows}}
-{{source=..\SamplesVB\Dock\CreatingWindows.vb region=gettingHiddenWindows}}
-
-````C#
-DockWindow[] hiddenWindows = radDock1.DockWindows.GetWindows(DockState.Hidden);
-
-````
-````VB.NET
-Dim hiddenWindows As DockWindow() = Me.RadDock1.DockWindows.GetWindows(DockState.Hidden)
-
-````
-
-{{endregion}}
+
+
+
+
You can get a desired ToolWindow\DocumentWindow by specifying its __Name__ as an index:
-{{source=..\SamplesCS\Dock\CreatingWindows.cs region=gettingWindowByName}}
-{{source=..\SamplesVB\Dock\CreatingWindows.vb region=gettingWindowByName}}
-
-````C#
-DockWindow window1 = this.radDock1.DockWindows["Form1"];
-// or simply
-DockWindow window2 = this.radDock1["Form1"];
-
-````
-````VB.NET
-Dim window1 As DockWindow = Me.RadDock1.DockWindows("Form1")
-' or simply
-Dim window2 As DockWindow = Me.RadDock1("Form1")
-
-````
-
-{{endregion}}
+
+
+
+
# See Also
diff --git a/controls/dock/object-model/alloweddockstates.md b/controls/dock/object-model/alloweddockstates.md
index 20e5e3a03..477835d7a 100644
--- a/controls/dock/object-model/alloweddockstates.md
+++ b/controls/dock/object-model/alloweddockstates.md
@@ -15,19 +15,10 @@ __AllowedDockState__ property gives you the ability to determine the available d
#### Allow two states only.
-{{source=..\SamplesCS\Dock\CreatingRadDock.cs region=allowedDockState}}
-{{source=..\SamplesVB\Dock\CreatingRadDock.vb region=allowedDockState}}
+
+
-````C#
-toolWindow1.AllowedDockState = AllowedDockState.Docked | AllowedDockState.Floating;
-
-````
-````VB.NET
-toolWindow1.AllowedDockState = AllowedDockState.Docked Or AllowedDockState.Floating
-
-````
-
-{{endregion}}
+
This automatically will remove the caption buttons that may be responsible for an unwanted state, for example *Closed*. In addition, the unwanted menu items from the context menu will be disabled:
@@ -37,19 +28,10 @@ The following setting will disable the __Floating__ option:
#### Disable the floating dock state
-{{source=..\SamplesCS\Dock\CreatingRadDock.cs region=notFloating}}
-{{source=..\SamplesVB\Dock\CreatingRadDock.vb region=notFloating}}
+
+
-````C#
-toolWindow1.AllowedDockState = ~AllowedDockState.Floating;
-
-````
-````VB.NET
-toolWindow1.AllowedDockState = Not AllowedDockState.Floating
-
-````
-
-{{endregion}}
+

diff --git a/controls/dock/object-model/creating-a-raddock-at-runtime.md b/controls/dock/object-model/creating-a-raddock-at-runtime.md
index 64440d8b7..364b04561 100644
--- a/controls/dock/object-model/creating-a-raddock-at-runtime.md
+++ b/controls/dock/object-model/creating-a-raddock-at-runtime.md
@@ -17,29 +17,10 @@ To create a __RadDock__ in code, construct a __RadDock__, set properties and add
#### Creating a simple RadDock instance
-{{source=..\SamplesCS\Dock\CreatingRadDock.cs region=creatingDock}}
-{{source=..\SamplesVB\Dock\CreatingRadDock.vb region=creatingDock}}
-
-````C#
-RadDock radDock1 = new RadDock();
-radDock1.Dock = DockStyle.Fill;
-this.Controls.Add(radDock1);
-ToolWindow toolWindow1 = new ToolWindow();
-toolWindow1.Text = "A ToolWindow";
-radDock1.DockWindow(toolWindow1, DockPosition.Left);
-
-````
-````VB.NET
-Dim radDock1 As RadDock = New RadDock()
-radDock1.Dock = DockStyle.Fill
-Me.Controls.Add(radDock1)
-Dim toolWindow1 As ToolWindow = New ToolWindow()
-toolWindow1.Text = "A ToolWindow"
-radDock1.DockWindow(toolWindow1, DockPosition.Left)
-
-````
-
-{{endregion}}
+
+
+
+
>caution You cannot set the DockPosition of the ToolWindow to Fill, unless you specify a target ToolWindow. If you try to set the DockPosition of a ToolWindow to Fill when there is no target ToolWindow, we throw an exception since a ToolWindow cannot fill RadDock entirely. This behavior is by design and it is the same as it is in Visual Studio. If you want to have a ToolWindow occupying RadDock entirely, you should dock it to a side (left/right/top/bottom) and set MainDocumentContainerVisible to false.
>
diff --git a/controls/dock/object-model/creating-toolwindow-and-documentwindow-at-runtime.md b/controls/dock/object-model/creating-toolwindow-and-documentwindow-at-runtime.md
index e8ed0ffe8..eba158567 100644
--- a/controls/dock/object-model/creating-toolwindow-and-documentwindow-at-runtime.md
+++ b/controls/dock/object-model/creating-toolwindow-and-documentwindow-at-runtime.md
@@ -17,50 +17,22 @@ To create a new __ToolWindow__, construct a __ToolWindow__ instance, set proper
#### Creating a ToolWindow
-{{source=..\SamplesCS\Dock\CreatingWindows.cs region=creatingToolWindow}}
-{{source=..\SamplesVB\Dock\CreatingWindows.vb region=creatingToolWindow}}
+
+
-````C#
-ToolWindow windowTop = new ToolWindow();
-windowTop.Text = "Window Top";
-this.radDock1.DockWindow(windowTop, DockPosition.Top);
-````
-````VB.NET
-
-Dim windowTop As ToolWindow = New ToolWindow()
-windowTop.Text = "Window Top"
-Me.RadDock1.DockWindow(windowTop, DockPosition.Top)
-````
-
-{{endregion}}
-
## Creating DocumentWindow at Runtime
To create a __DocumentWindow__, construct an instance of __DocumentWindow__, assign properties and call the __AddDocument__ method, passing the __DocumentWindow__ instance.
#### Creating a DocumentWindow
-{{source=..\SamplesCS\Dock\CreatingWindows.cs region=creatingDocumentWindow}}
-{{source=..\SamplesVB\Dock\CreatingWindows.vb region=creatingDocumentWindow}}
-
-````C#
-DocumentWindow documentTop = new DocumentWindow();
-documentTop.Text = "New Document";
-this.radDock1.AddDocument(documentTop);
+
+
-````
-````VB.NET
-Dim documentTop As DocumentWindow = New DocumentWindow()
-documentTop.Text = "New Document"
-Me.RadDock1.AddDocument(documentTop)
-````
-{{endregion}}
-
-
## Example: Creating Multiple ToolWindow and DocumentWindow at Runtime
The following example creates multiple panels and document panes at runtime.
@@ -69,53 +41,10 @@ The following example creates multiple panels and document panes at runtime.
#### Creating ToolWindows and DocumentWindows
-{{source=..\SamplesCS\Dock\CreatingWindows.cs region=winInitialization}}
-{{source=..\SamplesVB\Dock\CreatingWindows.vb region=winInitialization}}
-
-````C#
-ToolWindow windowLeft = new ToolWindow();
-windowLeft.Text = "Window Left";
-this.radDock1.DockWindow(windowLeft, DockPosition.Left);
-ToolWindow windowBottom = new ToolWindow();
-windowBottom.Text = "Window Bottom";
-this.radDock1.DockWindow(windowBottom, DockPosition.Bottom);
-ToolWindow windowBottomRight = new ToolWindow();
-windowBottomRight.Text = "Window Bottom Right";
-this.radDock1.DockWindow(windowBottomRight, windowBottom, DockPosition.Right);
-DocumentWindow document1 = new DocumentWindow();
-document1.Text = "Document 1";
-this.radDock1.AddDocument(document1);
-DocumentWindow document2 = new DocumentWindow();
-document2.Text = "Document 2";
-this.radDock1.AddDocument(document2);
-DocumentWindow document3 = new DocumentWindow();
-document3.Text = "Document 3";
-this.radDock1.AddDocument(document3);
-
-````
-````VB.NET
-Dim windowLeft As ToolWindow = New ToolWindow()
-windowLeft.Text = "Window Left"
-Me.RadDock1.DockWindow(windowLeft, DockPosition.Top)
-Dim windowBottom As ToolWindow = New ToolWindow()
-windowBottom.Text = "Window Bottom"
-Me.RadDock1.DockWindow(windowBottom, DockPosition.Bottom)
-Dim windowBottomRight As ToolWindow = New ToolWindow()
-windowBottomRight.Text = "Window Bottom Right"
-Me.RadDock1.DockWindow(windowBottomRight, windowBottom, DockPosition.Right)
-Dim document1 As DocumentWindow = New DocumentWindow()
-document1.Text = "Document 1"
-Me.RadDock1.AddDocument(document1)
-Dim document2 As DocumentWindow = New DocumentWindow()
-document2.Text = "Document 2"
-Me.RadDock1.AddDocument(document2)
-Dim document3 As DocumentWindow = New DocumentWindow()
-document3.Text = "Document 3"
-Me.RadDock1.AddDocument(document3)
-
-````
-
-{{endregion}}
+
+
+
+
## Creating and docking multiple windows in a single strip
@@ -125,56 +54,11 @@ There are cases in which you might prefer docking two or more windows to the rig
The bellow code shows how you can create each one of the windows:
-{{source=..\SamplesCS\Dock\How-To\DockingWindowsToRight.cs region=wrongApproach}}
-{{source=..\SamplesVB\Dock\How-To\DockingWindowsToRight.vb region=wrongApproach}}
-
-````C#
-private void menuItemTeamExplorer_Click1(object sender, EventArgs e)
-{
- TeamExplorerUserControl teuc = new TeamExplorerUserControl();
- DockPosition dockTo = DockPosition.Right;
- HostWindow hw = this.radDock1.DockControl(teuc, dockTo);
- hw.Text = "Team Explorer";
-}
-private void menuItemServerExplorer_Click1(object sender, EventArgs e)
-{
- ServerExplorerUserControl seuc = new ServerExplorerUserControl();
- DockPosition dockTo = DockPosition.Right;
- HostWindow hw = this.radDock1.DockControl(seuc, dockTo);
- hw.Text = "Server Explorer";
-}
-private void menuItemSolutionExplorer_Click1(object sender, EventArgs e)
-{
- SolutionExplorerUserControl seuc = new SolutionExplorerUserControl();
- DockPosition dockTo = DockPosition.Right;
- HostWindow hw = this.radDock1.DockControl(seuc, dockTo);
- hw.Text = "Solution Explorer";
-}
-
-````
-````VB.NET
-Private Sub menuItemTeamExplorer_Click1(ByVal sender As Object, ByVal e As EventArgs)
- Dim teuc As New TeamExplorerUserControl()
- Dim dockTo As DockPosition = DockPosition.Right
- Dim hw As HostWindow = Me.RadDock1.DockControl(teuc, dockTo)
- hw.Text = "Team Explorer"
-End Sub
-Private Sub menuItemServerExplorer_Click1(ByVal sender As Object, ByVal e As EventArgs)
- Dim seuc As New ServerExplorerUserControl()
- Dim dockTo As DockPosition = DockPosition.Right
- Dim hw As HostWindow = Me.RadDock1.DockControl(seuc, dockTo)
- hw.Text = "Server Explorer"
-End Sub
-Private Sub menuItemSolutionExplorer_Click1(ByVal sender As Object, ByVal e As EventArgs)
- Dim seuc As New SolutionExplorerUserControl()
- Dim dockTo As DockPosition = DockPosition.Right
- Dim hw As HostWindow = Me.RadDock1.DockControl(seuc, dockTo)
- hw.Text = "Solution Explorer"
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
+
However, this API docks the windows to right of **RadDock**, not taking into consideration other right-docked windows:

@@ -182,103 +66,10 @@ However, this API docks the windows to right of **RadDock**, not taking into con
So, we need to follow another approach. What we need to do is to globally define a **ToolTabStrip** variable that would be set the first time a window is right-docked. Then, the next time we dock a window, we will do it in the context of the already created **ToolTabStrip**. Here is what should be done in code on click of the menu items:
-{{source=..\SamplesCS\Dock\How-To\DockingWindowsToRight.cs region=menuItemsClick}}
-{{source=..\SamplesVB\Dock\How-To\DockingWindowsToRight.vb region=menuItemsClick}}
-
-````C#
-ToolTabStrip rightHandStrip = null;
-private void menuItemTeamExplorer_Click(object sender, EventArgs e)
-{
- TeamExplorerUserControl teuc = new TeamExplorerUserControl();
- ToolWindow teucW = new ToolWindow();
- teucW.Controls.Add(teuc);
- teucW.Text = "Team Explorer";
- if (rightHandStrip == null)
- {
- this.radDock1.DockWindow(teucW, DockPosition.Right);
- rightHandStrip = (ToolTabStrip)teucW.Parent;
- }
- else
- {
- this.radDock1.DockWindow(teucW, rightHandStrip, DockPosition.Fill);
- }
-}
-private void menuItemServerExplorer_Click(object sender, EventArgs e)
-{
- ServerExplorerUserControl seuc = new ServerExplorerUserControl();
- ToolWindow seucW = new ToolWindow();
- seucW.Controls.Add(seuc);
- seucW.Text = "Server Explorer";
- if (rightHandStrip == null)
- {
- this.radDock1.DockWindow(seucW, DockPosition.Right);
- rightHandStrip = (ToolTabStrip)seucW.Parent;
- }
- else
- {
- this.radDock1.DockWindow(seucW, rightHandStrip, DockPosition.Fill);
- }
-}
-private void menuItemSolutionExplorer_Click(object sender, EventArgs e)
-{
- SolutionExplorerUserControl seuc = new SolutionExplorerUserControl();
- ToolWindow seucW = new ToolWindow();
- seucW.Controls.Add(seuc);
- seucW.Text = "Solution Explorer";
- if (rightHandStrip == null)
- {
- this.radDock1.DockWindow(seucW, DockPosition.Right);
- rightHandStrip = (ToolTabStrip)seucW.Parent;
- }
- else
- {
- this.radDock1.DockWindow(seucW, rightHandStrip, DockPosition.Fill);
- }
-}
-
-````
-````VB.NET
-Private rightHandStrip As ToolTabStrip = Nothing
-Private Sub menuItemTeamExplorer_Click(ByVal sender As Object, ByVal e As EventArgs)
- Dim teuc As New TeamExplorerUserControl()
- Dim teucW As New ToolWindow()
- teucW.Controls.Add(teuc)
- teucW.Text = "Team Explorer"
- If rightHandStrip Is Nothing Then
- Me.RadDock1.DockWindow(teucW, DockPosition.Right)
- rightHandStrip = CType(teucW.Parent, ToolTabStrip)
- Else
- Me.RadDock1.DockWindow(teucW, rightHandStrip, DockPosition.Fill)
- End If
-End Sub
-Private Sub menuItemServerExplorer_Click(ByVal sender As Object, ByVal e As EventArgs)
- Dim seuc As New ServerExplorerUserControl()
- Dim seucW As New ToolWindow()
- seucW.Controls.Add(seuc)
- seucW.Text = "Server Explorer"
- If rightHandStrip Is Nothing Then
- Me.RadDock1.DockWindow(seucW, DockPosition.Right)
- rightHandStrip = CType(seucW.Parent, ToolTabStrip)
- Else
- Me.RadDock1.DockWindow(seucW, rightHandStrip, DockPosition.Fill)
- End If
-End Sub
-Private Sub menuItemSolutionExplorer_Click(ByVal sender As Object, ByVal e As EventArgs)
- Dim seuc As New SolutionExplorerUserControl()
- Dim seucW As New ToolWindow()
- seucW.Controls.Add(seuc)
- seucW.Text = "Solution Explorer"
- If rightHandStrip Is Nothing Then
- Me.RadDock1.DockWindow(seucW, DockPosition.Right)
- rightHandStrip = CType(seucW.Parent, ToolTabStrip)
- Else
- Me.RadDock1.DockWindow(seucW, rightHandStrip, DockPosition.Fill)
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
# See Also
diff --git a/controls/dock/object-model/customizing-floating-windows.md b/controls/dock/object-model/customizing-floating-windows.md
index fe36e9b63..1cb26d37f 100644
--- a/controls/dock/object-model/customizing-floating-windows.md
+++ b/controls/dock/object-model/customizing-floating-windows.md
@@ -17,28 +17,10 @@ __FloatingWindows__ provide a useful way of reordering pieces of content on your
In order to enable the `Maximize` and `Minimize` buttons for a **FloatingWindow**, you have to handle the `FloatingWindowCreated` event and set the **MinimizeBox**, **MaximizeBox** and **FormBorderStyle** properties of the **FloatingWindow** the following way:
-{{source=..\SamplesCS\Dock\CustomizingFloatingWindows.cs region=buttons}}
-{{source=..\SamplesVB\Dock\CustomizingFloatingWindows.vb region=buttons}}
-
-````C#
-void radDock1_FloatingWindowCreated1(object sender, Telerik.WinControls.UI.Docking.FloatingWindowEventArgs e)
-{
- e.Window.MaximizeBox = true;
- e.Window.MinimizeBox = true;
- e.Window.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
-}
-
-````
-````VB.NET
-Private Sub radDock1_FloatingWindowCreated1(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.Docking.FloatingWindowEventArgs)
- e.Window.MaximizeBox = True
- e.Window.MinimizeBox = True
- e.Window.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
The result is:

@@ -48,69 +30,17 @@ The result is:
Sometimes, you may want to prevent the **FloatingWindow** from being always on top of the form that contains the **RadDock** manager. In order to do that, you need to extend the **FloatingWindow** class and use an instance of the extended type.
In the extended **FloatingWindow** type, we need to override the **OnActivated** method, and after the base implementation takes place, we should remove the window from the collection of owned forms that the main form has:
-{{source=..\SamplesCS\Dock\CustomFloatingWindow.cs region=customFloatingWindow}}
-{{source=..\SamplesVB\Dock\CustomFloatingWindow.vb region=customFloatingWindow}}
-
-````C#
-public class CustomFloatingWindow : FloatingWindow
-{
- public CustomFloatingWindow(RadDock dockManager)
- : base(dockManager)
- {
- }
- protected override void OnActivated(EventArgs e)
- {
- base.OnActivated(e);
- Form dockForm = this.DockManager.FindForm();
- if (dockForm != null)
- {
- dockForm.RemoveOwnedForm(this);
- }
- }
-}
-
-````
-````VB.NET
-Public Class CustomFloatingWindow
- Inherits FloatingWindow
- Public Sub New(ByVal dockManager As RadDock)
- MyBase.New(dockManager)
- End Sub
- Protected Overrides Sub OnActivated(ByVal e As EventArgs)
- MyBase.OnActivated(e)
- Dim dockForm As Form = Me.DockManager.FindForm()
- If dockForm IsNot Nothing Then
- dockForm.RemoveOwnedForm(Me)
- End If
- End Sub
-End Class
-
-````
-
-{{endregion}}
+
+
+
+
Finally, we have to pass an instance of the custom **FloatingWindow** to the event arguments of the **FloatingWindowCreated** event:
-{{source=..\SamplesCS\Dock\CustomizingFloatingWindows.cs region=showBehind}}
-{{source=..\SamplesVB\Dock\CustomizingFloatingWindows.vb region=showBehind}}
-
-````C#
-void radDock1_FloatingWindowCreated2(object sender, Telerik.WinControls.UI.Docking.FloatingWindowEventArgs e)
-{
- CustomFloatingWindow customWindow = new CustomFloatingWindow(this.radDock1);
- e.Window = customWindow;
-}
-
-````
-````VB.NET
-Private Sub radDock1_FloatingWindowCreated2(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.Docking.FloatingWindowEventArgs)
- Dim customWindow As New CustomFloatingWindow(Me.RadDock1)
- e.Window = customWindow
-End Sub
+
+
-````
-
-{{endregion}}
+
Here is the result. As you can see, the form that contains the **RadDock** manager can cover the **FloatingWindow**:
@@ -120,24 +50,10 @@ Here is the result. As you can see, the form that contains the **RadDock** manag
**FloatingWindow** is a descendant class of **RadForm**. As such, **FloatingWindow** has the __ThemeName__ property that you can set in the **FloatingWindowCreated** event in order to change its theme:
-{{source=..\SamplesCS\Dock\CustomizingFloatingWindows.cs region=themeName}}
-{{source=..\SamplesVB\Dock\CustomizingFloatingWindows.vb region=themeName}}
-
-````C#
-void radDock1_FloatingWindowCreated3(object sender, Telerik.WinControls.UI.Docking.FloatingWindowEventArgs e)
-{
- e.Window.ThemeName = "TelerikMetroBlue";
-}
+
+
-````
-````VB.NET
-Private Sub radDock1_FloatingWindowCreated3(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.Docking.FloatingWindowEventArgs)
- e.Window.ThemeName = "TelerikMetroBlue"
-End Sub
-
-````
-
-{{endregion}}
+

diff --git a/controls/dock/object-model/customizing-tabstrip-items.md b/controls/dock/object-model/customizing-tabstrip-items.md
index f68fefdff..337b28087 100644
--- a/controls/dock/object-model/customizing-tabstrip-items.md
+++ b/controls/dock/object-model/customizing-tabstrip-items.md
@@ -18,79 +18,27 @@ This article demonstrates how you can customize or replace the **TabStrip** item
The above examples are using the __TabStripItemCreating__ event. This event cannot be accessed via the **RadDock** instance. You can subscribe to the event by using the static __RadDockEvents__ class. You should do that before the **InitializeComponent** method call:
-{{source=..\SamplesCS\Dock\CustomizingTabStripItems.cs region=subscribe}}
-{{source=..\SamplesVB\Dock\CustomizingTabStripItems.vb region=subscribe}}
+
+
-````C#
-public CustomizingTabStripItems()
-{
- RadDockEvents.TabStripItemCreating += RadDockEvents_TabStripItemCreating;
- InitializeComponent();
-}
-
-````
-````VB.NET
-Public Sub New()
- AddHandler RadDockEvents.TabStripItemCreating, AddressOf RadDockEvents_TabStripItemCreating
- InitializeComponent()
-End Sub
-
-````
-
-{{endregion}}
+
Please note that when such static events are used it is mandatory to unsubscribe from the event. If you do not do that the form would not be disposed properly:
-{{source=..\SamplesCS\Dock\CustomizingTabStripItems.cs region=closed}}
-{{source=..\SamplesVB\Dock\CustomizingTabStripItems.vb region=closed}}
-
-````C#
-protected override void OnClosed(EventArgs e)
-{
- RadDockEvents.TabStripItemCreating -= RadDockEvents_TabStripItemCreating;
- base.OnClosed(e);
-}
+
+
-````
-````VB.NET
-Protected Overrides Sub OnClosed(ByVal e As EventArgs)
- RemoveHandler RadDockEvents.TabStripItemCreating, AddressOf RadDockEvents_TabStripItemCreating
- MyBase.OnClosed(e)
-End Sub
-````
-
-{{endregion}}
## Adding element to the TabStrip item
The **TabStripItemCreating** event can be used for adding any kind of **RadElements** to the **TabStrip**. For example, the following code adds text box to each **TabStrip** item:
-{{source=..\SamplesCS\Dock\CustomizingTabStripItems.cs region=element}}
-{{source=..\SamplesVB\Dock\CustomizingTabStripItems.vb region=element}}
-
-````C#
-void RadDockEvents_TabStripItemCreating1(object sender, TabStripItemCreatingEventArgs args)
-{
- RadTextBoxControlElement textbox = new RadTextBoxControlElement();
- textbox.Margin = new System.Windows.Forms.Padding(80, 5, 5, 5);
- textbox.MinSize = new System.Drawing.Size(50, 0);
- args.TabItem.Children.Add(textbox);
-}
-
-````
-````VB.NET
-Private Sub RadDockEvents_TabStripItemCreating1(ByVal sender As Object, ByVal args As TabStripItemCreatingEventArgs)
- Dim textbox As New RadTextBoxControlElement()
- textbox.Margin = New System.Windows.Forms.Padding(80, 5, 5, 5)
- textbox.MinSize = New System.Drawing.Size(50, 0)
- args.TabItem.Children.Add(textbox)
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
The tabs will look like this:
@@ -100,102 +48,17 @@ The tabs will look like this:
The **TabStripItemCreating** event can be used for replacing the entire element as well. First you need to create a **TabStripItem** class descendant
-{{source=..\SamplesCS\Dock\CustomizingTabStripItems.cs region=Item}}
-{{source=..\SamplesVB\Dock\CustomizingTabStripItems.vb region=Item}}
-
-````C#
-class MyTabStripItem : TabStripItem
-{
- public MyTabStripItem(TabPanel panel)
- : base(panel)
- { }
- protected override void CreateChildElements()
- {
- base.CreateChildElements();
- this.Children.Add(CreateCustomElement());
- }
- RadElement CreateCustomElement()
- {
- StackLayoutElement element = new StackLayoutElement();
- element.Orientation = Orientation.Horizontal;
- element.StretchHorizontally = true;
- element.MinSize = new System.Drawing.Size(100, 0);
- RadButtonElement button = new RadButtonElement();
- button.Text = "Search";
- element.Children.Add(button);
- RadTextBoxControlElement textbox = new RadTextBoxControlElement();
- element.Children.Add(textbox);
- element.Margin = new Padding(5, 2, 2, 2);
- this.DrawText = false;
- this.Padding = new Padding(40, 5, 40, 5);
- return element;
- }
- protected override Type ThemeEffectiveType
- {
- get
- {
- return typeof(TabStripItem);
- }
- }
-}
-
-````
-````VB.NET
-Friend Class MyTabStripItem
- Inherits TabStripItem
- Public Sub New(ByVal panel As TabPanel)
- MyBase.New(panel)
- End Sub
- Protected Overrides Sub CreateChildElements()
- MyBase.CreateChildElements()
- Me.Children.Add(CreateCustomElement())
- End Sub
- Private Function CreateCustomElement() As RadElement
- Dim element As New StackLayoutElement()
- element.Orientation = Orientation.Horizontal
- element.StretchHorizontally = True
- element.MinSize = New System.Drawing.Size(100, 0)
- Dim button As New RadButtonElement()
- button.Text = "Search"
- element.Children.Add(button)
- Dim textbox As New RadTextBoxControlElement()
- element.Children.Add(textbox)
- element.Margin = New Padding(5, 2, 2, 2)
- Me.DrawText = False
- Me.Padding = New Padding(40, 5, 40, 5)
- Return element
- End Function
- Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
- Get
- Return GetType(TabStripItem)
- End Get
- End Property
-End Class
-
-````
-
-{{endregion}}
+
+
+
+
Then you can just replace the default item:
-{{source=..\SamplesCS\Dock\CustomizingTabStripItems.cs region=replace}}
-{{source=..\SamplesVB\Dock\CustomizingTabStripItems.vb region=replace}}
-
-````C#
-void RadDockEvents_TabStripItemCreating(object sender, TabStripItemCreatingEventArgs args)
-{
- args.TabItem = new MyTabStripItem(args.TabItem.TabPanel);
-}
-
-````
-````VB.NET
-Private Sub RadDockEvents_TabStripItemCreating(ByVal sender As Object, ByVal args As TabStripItemCreatingEventArgs)
- args.TabItem = New MyTabStripItem(args.TabItem.TabPanel)
-End Sub
-
-````
+
+
-{{endregion}}
+
The tabs will look like in the following image:
@@ -209,70 +72,18 @@ The tab items of the __DocumentWindows__ in __RadDock__ have a predefined shape
>note Since the __TabStripItemCreating__ event is static the event subscription have to be defined before the call to the InitializeComponent method.
>
-{{source=..\SamplesCS\Dock\CustomizingTabStripItemsForm.cs region=MultiLineRowLayoutInit}}
-{{source=..\SamplesVB\Dock\CustomizingTabStripItemsForm.vb region=MultiLineRowLayoutInit}}
-
-````C#
-public CustomizingTabStripItemsForm()
-{
- RadDockEvents.TabStripItemCreating += RadDockEvents_TabStripItemCreating;
- InitializeComponent();
- DocumentContainer container = this.documentContainer1;
- DocumentTabStrip tabStrip = container.Controls[0] as DocumentTabStrip;
- if (tabStrip != null)
- {
- tabStrip.TabStripElement.ItemFitMode = StripViewItemFitMode.MultiLine;
- }
-}
-void RadDockEvents_TabStripItemCreating(object sender, TabStripItemCreatingEventArgs args)
-{
- args.TabItem.Shape = new ChamferedRectShape();
- args.TabItem.Padding = new System.Windows.Forms.Padding(4, 4, 7, 4);
-}
-
-````
-````VB.NET
-Public Sub New()
- AddHandler RadDockEvents.TabStripItemCreating, AddressOf RadDockEvents_TabStripItemCreating
- InitializeComponent()
- Dim container As DocumentContainer = Me.DocumentContainer1
- Dim tabStrip As DocumentTabStrip = TryCast(container.Controls(0), DocumentTabStrip)
- If tabStrip IsNot Nothing Then
- tabStrip.TabStripElement.ItemFitMode = StripViewItemFitMode.MultiLine
- End If
-End Sub
-Private Sub RadDockEvents_TabStripItemCreating(sender As Object, args As TabStripItemCreatingEventArgs)
- args.TabItem.Shape = New ChamferedRectShape()
- args.TabItem.Padding = New System.Windows.Forms.Padding(4, 4, 7, 4)
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
>note Because we are subscribing to a static event, we need to take care of the unscibription as well. Otherwise the form would not be disposed properly.
>
-{{source=..\SamplesCS\Dock\CustomizingTabStripItems.cs region=closed}}
-{{source=..\SamplesVB\Dock\CustomizingTabStripItems.vb region=closed}}
-
-````C#
-protected override void OnClosed(EventArgs e)
-{
- RadDockEvents.TabStripItemCreating -= RadDockEvents_TabStripItemCreating;
- base.OnClosed(e);
-}
-
-````
-````VB.NET
-Protected Overrides Sub OnClosed(ByVal e As EventArgs)
- RemoveHandler RadDockEvents.TabStripItemCreating, AddressOf RadDockEvents_TabStripItemCreating
- MyBase.OnClosed(e)
-End Sub
+
+
-````
-{{endregion}}
Here is the outcome of the code above:
diff --git a/controls/dock/object-model/example-building-an-advanced-layout-at-runtime.md b/controls/dock/object-model/example-building-an-advanced-layout-at-runtime.md
index 2d2d70186..da692f732 100644
--- a/controls/dock/object-model/example-building-an-advanced-layout-at-runtime.md
+++ b/controls/dock/object-model/example-building-an-advanced-layout-at-runtime.md
@@ -29,29 +29,10 @@ So, let's start building the layout:
#### Docking two ToolWindows
-{{source=..\SamplesCS\Dock\BuildingAdvancedLayout.cs region=dockingTwoToolWindows}}
-{{source=..\SamplesVB\Dock\BuildingAdvancedLayout.vb region=dockingTwoToolWindows}}
-
-````C#
-ToolWindow window1 = new ToolWindow();
-window1.Name = "window1";
-this.radDock1.DockWindow(window1, DockPosition.Left);
-ToolWindow window2 = new ToolWindow();
-window2.Name = "window2";
-this.radDock1.DockWindow(window2, window1, DockPosition.Bottom);
-
-````
-````VB.NET
-Dim window1 As ToolWindow = New ToolWindow()
-window1.Name = "window1"
-Me.RadDock1.DockWindow(window1, DockPosition.Left)
-Dim window2 As ToolWindow = New ToolWindow()
-window2.Name = "window2"
-Me.RadDock1.DockWindow(window2, window1, DockPosition.Bottom)
-
-````
-
-{{endregion}}
+
+
+
+

@@ -59,21 +40,10 @@ Me.RadDock1.DockWindow(window2, window1, DockPosition.Bottom)
#### Setting relative size
-{{source=..\SamplesCS\Dock\BuildingAdvancedLayout.cs region=settingRelativeSize}}
-{{source=..\SamplesVB\Dock\BuildingAdvancedLayout.vb region=settingRelativeSize}}
-
-````C#
-window2.TabStrip.SizeInfo.SizeMode = SplitPanelSizeMode.Relative;
-window2.TabStrip.SizeInfo.RelativeRatio = new SizeF(0, 0.33f);
+
+
-````
-````VB.NET
-window2.TabStrip.SizeInfo.SizeMode = SplitPanelSizeMode.Relative
-window2.TabStrip.SizeInfo.RelativeRatio = New System.Drawing.SizeF(0, 0.33F)
-
-````
-
-{{endregion}}
+
The result is shown on the picture below:
@@ -87,33 +57,10 @@ Now, if we decide to resize the form, the ration of the **TabStrips**' height wi
#### Setting absolute size
-{{source=..\SamplesCS\Dock\BuildingAdvancedLayout.cs region=settingAbsoliteSize}}
-{{source=..\SamplesVB\Dock\BuildingAdvancedLayout.vb region=settingAbsoliteSize}}
-
-````C#
-ToolWindow window3 = new ToolWindow();
-window3.Name = "window3";
-this.radDock1.DockWindow(window3, DockPosition.Bottom);
-ToolWindow window4 = new ToolWindow();
-window4.Name = "window4";
-this.radDock1.DockWindow(window4, window3, DockPosition.Right);
-window4.TabStrip.SizeInfo.SizeMode = SplitPanelSizeMode.Absolute;
-window4.TabStrip.SizeInfo.AbsoluteSize = new Size(150, 0);
-
-````
-````VB.NET
-Dim window3 As ToolWindow = New ToolWindow()
-window3.Name = "window3"
-Me.RadDock1.DockWindow(window3, DockPosition.Bottom)
-Dim window4 As ToolWindow = New ToolWindow()
-window4.Name = "window4"
-Me.RadDock1.DockWindow(window4, window3, DockPosition.Right)
-window4.TabStrip.SizeInfo.SizeMode = SplitPanelSizeMode.Absolute
-window4.TabStrip.SizeInfo.AbsoluteSize = New Size(150, 0)
-
-````
-
-{{endregion}}
+
+
+
+
This time we set the __Width__ of the `window4` to an absolute value of 150 pixels.
@@ -125,29 +72,10 @@ This time we set the __Width__ of the `window4` to an absolute value of 150 pixe
#### Floating ToolWindows
-{{source=..\SamplesCS\Dock\BuildingAdvancedLayout.cs region=floatingWindows}}
-{{source=..\SamplesVB\Dock\BuildingAdvancedLayout.vb region=floatingWindows}}
-
-````C#
-ToolWindow window5 = new ToolWindow();
-window5.Name = "window5";
-this.radDock1.FloatWindow(window5, new Rectangle(250, 250, 300, 150));
-ToolWindow window6 = new ToolWindow();
-window6.Name = "window6";
-this.radDock1.DockWindow(window6, window5, DockPosition.Right);
-
-````
-````VB.NET
-Dim window5 As ToolWindow = New ToolWindow()
-window5.Name = "window5"
-Me.RadDock1.FloatWindow(window5, New Rectangle(250, 250, 300, 150))
-Dim window6 As ToolWindow = New ToolWindow()
-window6.Name = "window6"
-Me.RadDock1.DockWindow(window6, window5, DockPosition.Right)
-
-````
-
-{{endregion}}
+
+
+
+

@@ -155,27 +83,10 @@ Me.RadDock1.DockWindow(window6, window5, DockPosition.Right)
#### Setting the AutoHidePosition and AutoHideSize properties
-{{source=..\SamplesCS\Dock\BuildingAdvancedLayout.cs region=autoHide}}
-{{source=..\SamplesVB\Dock\BuildingAdvancedLayout.vb region=autoHide}}
-
-````C#
-ToolWindow window7 = new ToolWindow();
-window7.Name = "window7";
-window7.AutoHideSize = new Size(100, 100);
-this.radDock1.DockWindow(window7, window4, DockPosition.Bottom);
-((ToolTabStrip)window7.TabStrip).AutoHidePosition = AutoHidePosition.Top;
+
+
-````
-````VB.NET
-Dim window7 As ToolWindow = New ToolWindow()
-window7.Name = "window7"
-window7.AutoHideSize = New Drawing.Size(100, 100)
-Me.RadDock1.DockWindow(window7, window4, DockPosition.Bottom)
-CType(window7.TabStrip, ToolTabStrip).AutoHidePosition = AutoHidePosition.Top
-
-````
-
-{{endregion}}
+
Initially, the layout will look like this:
@@ -189,29 +100,10 @@ If the user clicks the `Pin` button of `window7`, it will become auto-hidden to
#### Adding DocumentWindows
-{{source=..\SamplesCS\Dock\BuildingAdvancedLayout.cs region=addingDocumentWindows}}
-{{source=..\SamplesVB\Dock\BuildingAdvancedLayout.vb region=addingDocumentWindows}}
-
-````C#
-DocumentWindow document1 = new DocumentWindow();
-document1.Name = "document1";
-this.radDock1.AddDocument(document1);
-DocumentWindow document2 = new DocumentWindow();
-document2.Name = "document2";
-this.radDock1.AddDocument(document2, document1, DockPosition.Bottom);
-
-````
-````VB.NET
-Dim document1 As DocumentWindow = New DocumentWindow()
-document1.Name = "document1"
-Me.RadDock1.AddDocument(document1)
-Dim document2 As DocumentWindow = New DocumentWindow()
-document2.Name = "document2"
-Me.RadDock1.AddDocument(document2, document1, DockPosition.Bottom)
-
-````
+
+
-{{endregion}}
+

@@ -220,19 +112,10 @@ However, you may not want to have any documents. In this case, set the __MainDoc
#### Hiding the main DocumentContainer
-{{source=..\SamplesCS\Dock\BuildingAdvancedLayout.cs region=dockContainerVisible}}
-{{source=..\SamplesVB\Dock\BuildingAdvancedLayout.vb region=dockContainerVisible}}
-
-````C#
-this.radDock1.MainDocumentContainerVisible = false;
-
-````
-````VB.NET
-Me.RadDock1.MainDocumentContainerVisible = False
+
+
-````
-
-{{endregion}}
+

diff --git a/controls/dock/object-model/tabs-and-captions.md b/controls/dock/object-model/tabs-and-captions.md
index b7950bcbb..fbcf4c059 100644
--- a/controls/dock/object-model/tabs-and-captions.md
+++ b/controls/dock/object-model/tabs-and-captions.md
@@ -21,19 +21,10 @@ __RadDock__ exposes several properties which allow you to have full control over
#### Setting DocumentTabsAlignment to Left
-{{source=..\SamplesCS\Dock\TabsAndCaptions.cs region=documentTabsAlignment}}
-{{source=..\SamplesVB\Dock\TabsAndCaptions.vb region=documentTabsAlignment}}
+
+
-````C#
-this.radDock1.DocumentTabsAlignment = TabStripAlignment.Left;
-
-````
-````VB.NET
-Me.RadDock1.DocumentTabsAlignment = TabStripAlignment.Left
-
-````
-
-{{endregion}}
+

@@ -42,19 +33,10 @@ Me.RadDock1.DocumentTabsAlignment = TabStripAlignment.Left
#### Hiding the document tabs
-{{source=..\SamplesCS\Dock\TabsAndCaptions.cs region=documentTabsVisible}}
-{{source=..\SamplesVB\Dock\TabsAndCaptions.vb region=documentTabsVisible}}
-
-````C#
-this.radDock1.DocumentTabsVisible = false;
-
-````
-````VB.NET
-Me.RadDock1.DocumentTabsVisible = False
+
+
-````
-
-{{endregion}}
+

@@ -63,19 +45,10 @@ Me.RadDock1.DocumentTabsVisible = False
#### Setting the ToolTabsAlignment to Right
-{{source=..\SamplesCS\Dock\TabsAndCaptions.cs region=toolTabsAlignment}}
-{{source=..\SamplesVB\Dock\TabsAndCaptions.vb region=toolTabsAlignment}}
-
-````C#
-this.radDock1.ToolTabsAlignment = TabStripAlignment.Right;
+
+
-````
-````VB.NET
-Me.RadDock1.ToolTabsAlignment = TabStripAlignment.Right
-
-````
-
-{{endregion}}
+

@@ -84,19 +57,10 @@ Me.RadDock1.ToolTabsAlignment = TabStripAlignment.Right
#### Hiding the tool tabs
-{{source=..\SamplesCS\Dock\TabsAndCaptions.cs region=toolTabsVisible}}
-{{source=..\SamplesVB\Dock\TabsAndCaptions.vb region=toolTabsVisible}}
+
+
-````C#
-this.radDock1.ToolTabsVisible = false;
-
-````
-````VB.NET
-Me.RadDock1.ToolTabsVisible = False
-
-````
-
-{{endregion}}
+

@@ -104,19 +68,10 @@ Me.RadDock1.ToolTabsVisible = False
#### Hiding the caption of ToolTabStrip
-{{source=..\SamplesCS\Dock\TabsAndCaptions.cs region=captionVisible}}
-{{source=..\SamplesVB\Dock\TabsAndCaptions.vb region=captionVisible}}
-
-````C#
-this.toolTabStrip1.CaptionVisible = false;
-
-````
-````VB.NET
-Me.ToolTabStrip1.CaptionVisible = False
+
+
-````
-
-{{endregion}}
+

@@ -124,21 +79,10 @@ Me.ToolTabStrip1.CaptionVisible = False
#### Showing close buttons
-{{source=..\SamplesCS\Dock\TabsAndCaptions.cs region=showToolCloseButton}}
-{{source=..\SamplesVB\Dock\TabsAndCaptions.vb region=showToolCloseButton}}
-
-````C#
-this.radDock1.ShowToolCloseButton = true;
-this.radDock1.ShowDocumentCloseButton = true;
+
+
-````
-````VB.NET
-Me.RadDock1.ShowToolCloseButton = True
-Me.RadDock1.ShowDocumentCloseButton = True
-
-````
-
-{{endregion}}
+

diff --git a/controls/dock/object-model/toolwindow-and-documentwindow-properties-and-methods.md b/controls/dock/object-model/toolwindow-and-documentwindow-properties-and-methods.md
index 8de0fbc34..5deda3cdc 100644
--- a/controls/dock/object-model/toolwindow-and-documentwindow-properties-and-methods.md
+++ b/controls/dock/object-model/toolwindow-and-documentwindow-properties-and-methods.md
@@ -45,19 +45,10 @@ __ToolWindow__ and __DocumentWindow__ both implement the same interfaces, such a
#### Using DockTo()
-{{source=..\SamplesCS\Dock\CreatingWindows.cs region=usingDockTo}}
-{{source=..\SamplesVB\Dock\CreatingWindows.vb region=usingDockTo}}
+
+
-````C#
-toolWindow2.DockTo(toolWindow1, DockPosition.Fill);
-
-````
-````VB.NET
-toolWindow2.DockTo(ToolWindow1, DockPosition.Fill)
-
-````
-
-{{endregion}}
+
# See Also
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/autocompletemodes.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/autocompletemodes.md
index 9beb950e5..fd85e4cf4 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/autocompletemodes.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/autocompletemodes.md
@@ -18,19 +18,10 @@ You can set the __AutoCompleteMode__ as follows:
#### Set AutoCompleteMode
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\AutoCompleteModes1.cs region=SetMode}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\AutoCompleteModes1.vb region=SetMode}}
+
+
-````C#
-this.radCheckedDropDownList1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
-````
-````VB.NET
-Me.RadCheckedDropDownList1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
-
-````
-
-{{endregion}}
* *None*: Nothing happens when a user begins to type into the text box portion of the control.
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/customizing-appearance/accessing-and-customizing-elements.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/customizing-appearance/accessing-and-customizing-elements.md
index 26e6dc49b..3151ee084 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/customizing-appearance/accessing-and-customizing-elements.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/customizing-appearance/accessing-and-customizing-elements.md
@@ -33,27 +33,10 @@ You can customize the nested elements at run time as well:
#### Customize elements
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\Customization1.cs region=CustomizeElements}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\Customization1.vb region=CustomizeElements}}
-
-````C#
-
-this.radCheckedDropDownList1.DropDownListElement.ArrowButton.Fill.BackColor = Color.Aqua;
-this.radCheckedDropDownList1.DropDownListElement.EditableElement.BorderColor = Color.Red;
-this.radCheckedDropDownList1.DropDownListElement.EditableElement.DrawBorder = true;
-this.radCheckedDropDownList1.DropDownListElement.EditableElement.BorderGradientStyle = GradientStyles.Solid;
-this.radCheckedDropDownList1.DropDownListElement.EditableElement.BorderWidth = 1;
-
-````
-````VB.NET
-Me.RadCheckedDropDownList1.DropDownListElement.ArrowButton.Fill.BackColor = Color.Aqua
-Me.RadCheckedDropDownList1.DropDownListElement.EditableElement.BorderColor = Color.Red
-Me.RadCheckedDropDownList1.DropDownListElement.EditableElement.DrawBorder = True
-Me.RadCheckedDropDownList1.DropDownListElement.EditableElement.BorderGradientStyle = GradientStyles.Solid
-Me.RadCheckedDropDownList1.DropDownListElement.EditableElement.BorderWidth = 1
-
-````
-
-{{endregion}}
+
+
+
+
+
In order to style the pop-up items it is suitable to use the [Formatting Items]({%slug winforms/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/customization%}) event.
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/customizing-appearance/customization.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/customizing-appearance/customization.md
index 7369c2481..caf727653 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/customizing-appearance/customization.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/customizing-appearance/customization.md
@@ -20,58 +20,18 @@ In order to customize the editable area, you must subscribe to the __TextBlockFo
#### Subscribe to TextBlockFormatting
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\Customization1.cs region=TextBlockFormattingSubscribe}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\Customization1.vb region=TextBlockFormattingSubscribe}}
+
+
-````C#
-this.radCheckedDropDownList1.TextBlockFormatting += radCheckedDropDownList1_TextBlockFormatting;
-````
-````VB.NET
-AddHandler Me.RadCheckedDropDownList1.TextBlockFormatting, AddressOf radCheckedDropDownList1_TextBlockFormatting
-````
-{{endregion}}
+#### Modify properties
+
+
-#### Modify properties
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\Customization1.cs region=TextBlockFormattingHandler}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\Customization1.vb region=TextBlockFormattingHandler}}
-
-````C#
-void radCheckedDropDownList1_TextBlockFormatting(object sender, TextBlockFormattingEventArgs e)
-{
- TokenizedTextBlockElement token = e.TextBlock as TokenizedTextBlockElement;
- if (token != null)
- {
- token.ForeColor = Color.DarkBlue;
- token.DrawFill = false;
- token.BorderColor = Color.DarkRed;
- token.BorderWidth = 1.3f;
- token.DrawBorder = true;
- token.BorderGradientStyle = GradientStyles.Solid;
- }
-}
-
-````
-````VB.NET
-Private Sub radCheckedDropDownList1_TextBlockFormatting(sender As Object, e As TextBlockFormattingEventArgs)
- Dim token As TokenizedTextBlockElement = TryCast(e.TextBlock, TokenizedTextBlockElement)
- If token IsNot Nothing Then
- token.ForeColor = Color.DarkBlue
- token.DrawFill = False
- token.BorderColor = Color.DarkRed
- token.BorderWidth = 1.3F
- token.DrawBorder = True
- token.BorderGradientStyle = GradientStyles.Solid
- End If
-End Sub
-
-````
-
-{{endregion}}
>caption Figure 1: Customizing tokens
@@ -83,54 +43,18 @@ Customizing the drop down items is similar. Subscribe to the __VisualListItemFor
#### Subscribe to VisualListItemFormatting
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\Customization1.cs region=VisualListItemFormattingSubscribe}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\Customization1.vb region=VisualListItemFormattingSubscribe}}
+
+
-````C#
-this.radCheckedDropDownList1.VisualListItemFormatting += radCheckedDropDownList1_VisualListItemFormatting;
-````
-````VB.NET
-AddHandler Me.RadCheckedDropDownList1.VisualListItemFormatting, AddressOf radCheckedDropDownList1_VisualListItemFormatting
-````
-{{endregion}}
+#### Modify properties
+
+
-#### Modify properties
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\Customization1.cs region=VisualListItemFormattingHandler}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\Customization1.vb region=VisualListItemFormattingHandler}}
-
-````C#
-void radCheckedDropDownList1_VisualListItemFormatting(object sender, VisualItemFormattingEventArgs args)
-{
- bool itemChecked = ((RadCheckedListDataItem)args.VisualItem.Data).Checked;
- if (itemChecked)
- {
- args.VisualItem.ForeColor = Color.Green;
- }
- else
- {
- args.VisualItem.ForeColor = Color.Red;
- }
-}
-
-````
-````VB.NET
-Private Sub radCheckedDropDownList1_VisualListItemFormatting(sender As Object, args As VisualItemFormattingEventArgs)
- Dim itemChecked As Boolean = DirectCast(args.VisualItem.Data, RadCheckedListDataItem).Checked
- If itemChecked Then
- args.VisualItem.ForeColor = Color.Green
- Else
- args.VisualItem.ForeColor = Color.Red
- End If
-End Sub
-
-````
-
-{{endregion}}
>caption Figure 2: Customizing dropdown items
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/getting-started.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/getting-started.md
index 0d1ed328e..2e65ce563 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/getting-started.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/getting-started.md
@@ -57,22 +57,10 @@ The following tutorial demonstrates how to populate __RadCheckedDropDownList__ a
#### Handling ItemCheckedChanged event
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\GettingStarted1.cs region=AddItems}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\GettingStarted1.vb region=AddItems}}
-
-````C#
-private void radCheckedDropDownList1_ItemCheckedChanged(object sender, RadCheckedListDataItemEventArgs e)
-{
- RadMessageBox.Show(" Item >> " + e.Item.Text + " Checked state >> " + e.Item.Checked);
-}
-
-````
-````VB.NET
-Private Sub radCheckedDropDownList1_ItemCheckedChanged(sender As Object, e As RadCheckedListDataItemEventArgs)
- RadMessageBox.Show(" Item >> " + e.Item.Text + " Checked state >> " + e.Item.Checked)
-End Sub
-
-````
+
+
+
+
>caption Figure 2: Handling ItemCheckedChanged
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/how-to/add-non-existing-items.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/how-to/add-non-existing-items.md
index 6d027efca..e1afd5727 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/how-to/add-non-existing-items.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/how-to/add-non-existing-items.md
@@ -17,55 +17,18 @@ For this purpose, __RadCheckedDropDownList__ has the __TokenValidating__ event.
#### Subscribe for TokenValidating
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\How-To\AddNonExistingItems1.cs region=Subscribe}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\How-To\AddNonExistingItems1.vb region=Subscribe}}
+
+
-````C#
-this.radCheckedDropDownList1.TokenValidating += radCheckedDropDownList1_TokenValidating;
-````
-````VB.NET
-AddHandler Me.RadCheckedDropDownList1.TokenValidating, AddressOf radCheckedDropDownList1_TokenValidating
-````
-{{endregion}}
+#### Add non-existing items
+
+
-#### Add non-existing items
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\How-To\AddNonExistingItems1.cs region=Handler}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\How-To\AddNonExistingItems1.vb region=Handler}}
-
-````C#
-void radCheckedDropDownList1_TokenValidating(object sender, TokenValidatingEventArgs e)
-{
- if (!e.IsValidToken)
- {
- AutoCompleteBoxViewElement textBox = sender as AutoCompleteBoxViewElement;
- if (this.radCheckedDropDownList1.DropDownListElement.FindStringExact(e.Text) == -1)
- {
- this.radCheckedDropDownList1.Items.Add(new RadCheckedListDataItem(e.Text, false));
- e.IsValidToken = true;
- }
- }
-}
-
-````
-````VB.NET
-Private Sub radCheckedDropDownList1_TokenValidating(sender As Object, e As TokenValidatingEventArgs)
- If Not e.IsValidToken Then
- Dim textBox As AutoCompleteBoxViewElement = TryCast(sender, AutoCompleteBoxViewElement)
- If Me.RadCheckedDropDownList1.DropDownListElement.FindStringExact(e.Text) = -1 Then
- Me.RadCheckedDropDownList1.Items.Add(New RadCheckedListDataItem(e.Text, False))
- e.IsValidToken = True
- End If
- End If
-End Sub
-
-````
-
-{{endregion}}
>note In order to make the custom text a valid token, it is necessary to enter the delimeter which is __;__ by default.
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/how-to/use-as-radgridview-editor.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/how-to/use-as-radgridview-editor.md
index 46fe9dfb0..020eaefb6 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/how-to/use-as-radgridview-editor.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/how-to/use-as-radgridview-editor.md
@@ -24,144 +24,30 @@ As many other RadControls, __RadCheckedDropDownList__ can also be used as [edito
#### Initialize
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\How-To\UseAsRadGridViewEditor1.cs region=InitGrid}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\How-To\UseAsRadGridViewEditor1.vb region=InitGrid}}
+
+
+
+
-````C#
-
-BindingList columnData;
-BindingList datasource;
-public UseAsRadGridViewEditor1()
-{
- InitializeComponent();
-
- columnData = new BindingList();
- datasource = new BindingList();
-
- for (int i = 0; i < 5; i++)
- {
- datasource.Add(new MyPart("Part " + i + ";Part " + (i + 1) + ";"));
- }
- radGridView1.AutoGenerateColumns = false;
- radGridView1.DataSource = datasource;
-
- GridViewTextBoxColumn checkedDropDownListColumn = new GridViewTextBoxColumn();
- checkedDropDownListColumn.FieldName = "CurrentParts";
- checkedDropDownListColumn.Width = 200;
-
- this.radGridView1.Columns.Add(checkedDropDownListColumn);
-
- for (int i = 0; i < 10; i++)
- {
- columnData.Add(new MyPart("Part " + i));
- }
-
- this.radGridView1.EditorRequired += radGridView1_EditorRequired;
-}
-
-````
-````VB.NET
-Private columnData As BindingList(Of MyPart)
-Private datasource As BindingList(Of MyPart)
-Public Sub New()
- InitializeComponent()
- columnData = New BindingList(Of MyPart)()
- datasource = New BindingList(Of MyPart)()
- For i As Integer = 0 To 4
- datasource.Add(New MyPart("Part " & i & ";Part " & (i + 1) & ";"))
- Next i
- radGridView1.AutoGenerateColumns = False
- radGridView1.DataSource = datasource
- Dim checkedDropDownListColumn As New GridViewTextBoxColumn()
- checkedDropDownListColumn.FieldName = "CurrentParts"
- checkedDropDownListColumn.Width = 200
- Me.RadGridView1.Columns.Add(checkedDropDownListColumn)
- For i As Integer = 0 To 9
- columnData.Add(New MyPart("Part " & i))
- Next i
- AddHandler Me.radGridView1.EditorRequired, AddressOf radGridView1_EditorRequired
-End Sub
-
-````
-
-{{endregion}}
2\. The next step is to replace the default editor. This can be achieved by handling the __EditorReqired__ event. This is the place where the data source should be set as well.
#### Change the editor
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\How-To\UseAsRadGridViewEditor1.cs region=Required}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\How-To\UseAsRadGridViewEditor1.vb region=Required}}
-
-````C#
-
-void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
-{
- if (this.radGridView1.CurrentColumn.Index == 0)
- {
- RadCheckedDropDownListElement editor = new GridViewCheckedDropDownListEditor();
- editor.DataSource = this.columnData;
- editor.DisplayMember = "CurrentParts";
- e.Editor = editor;
- }
-}
-
-````
-````VB.NET
-Private Sub radGridView1_EditorRequired(ByVal sender As Object, ByVal e As EditorRequiredEventArgs)
- If Me.radGridView1.CurrentColumn.Index = 0 Then
- Dim editor As RadCheckedDropDownListElement = New GridViewCheckedDropDownListEditor()
- editor.DataSource = Me.columnData
- editor.DisplayMember = "CurrentParts"
- e.Editor = editor
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
+
3\. The final step is creating the editor. This can be achieved by creating a descendant of __RadCheckedDropDownListElement__ and overriding its __Value__ property.
#### Editor
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\How-To\UseAsRadGridViewEditor1.cs region=Editor}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\How-To\UseAsRadGridViewEditor1.vb region=Editor}}
+
+
+
-````C#
-
-public class GridViewCheckedDropDownListEditor : RadCheckedDropDownListElement
-{
- public override object Value
- {
- get
- {
- return this.Text;
- }
- set
- {
- this.Text = value.ToString();
- }
- }
-}
-
-````
-````VB.NET
-Public Class GridViewCheckedDropDownListEditor
- Inherits RadCheckedDropDownListElement
- Public Overrides Property Value() As Object
- Get
- Return Me.Text
- End Get
- Set(ByVal value As Object)
- Me.Text = value.ToString()
- End Set
- End Property
-End Class
-
-````
-
-{{endregion}}
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/populating-with-data/adding-items-programmatically.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/populating-with-data/adding-items-programmatically.md
index 1146fa552..6fb111180 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/populating-with-data/adding-items-programmatically.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/populating-with-data/adding-items-programmatically.md
@@ -28,34 +28,10 @@ You can use one of the following item types:
#### Add items programmatically
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\CheckedDropDownList1.cs region=AddItemsProgrammatically}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\CheckedDropDownList1.vb region=AddItemsProgrammatically}}
-
-````C#
-RadCheckedListDataItem dataItem = new RadCheckedListDataItem();
-dataItem.Text = "Chicken toast";
-radCheckedDropDownList1.Items.Add(dataItem);
-
-DescriptionTextCheckedListDataItem descriptionItem = new DescriptionTextCheckedListDataItem();
-descriptionItem.Text = "Chicken wings";
-descriptionItem.Checked = true;
-descriptionItem.DescriptionText = "some description";
-radCheckedDropDownList1.Items.Add(descriptionItem);
-
-````
-````VB.NET
-Dim dataItem As New RadCheckedListDataItem()
-dataItem.Text = "Chicken toast"
-radCheckedDropDownList1.Items.Add(dataItem)
-Dim descriptionItem As New DescriptionTextCheckedListDataItem()
-descriptionItem.Text = "Chicken wings"
-descriptionItem.Checked = True
-descriptionItem.DescriptionText = "some description"
-radCheckedDropDownList1.Items.Add(descriptionItem)
-
-````
-
-{{endregion}}
+
+
+
+
# See Also
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/populating-with-data/data-binding.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/populating-with-data/data-binding.md
index 6d7d32366..fcbebdb05 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/populating-with-data/data-binding.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/populating-with-data/data-binding.md
@@ -56,148 +56,20 @@ First, our model. It must implement the __INotifyPropertyChanged__ interface, so
#### Model
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\DataBinding1.cs region=Model}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\DataBinding1.vb region=Model}}
-
-````C#
-class Model : INotifyPropertyChanged
-{
- private int id;
- private bool selected;
- private string name;
- public int Id
- {
- get { return this.id; }
- set { this.id = value; this.OnPropertyChanged("Id"); }
- }
- public bool Selected
- {
- get { return this.selected; }
- set { this.selected = value; this.OnPropertyChanged("Selected"); }
- }
- public string Name
- {
- get { return this.name; }
- set { this.name = value; this.OnPropertyChanged("Name"); }
- }
- public event PropertyChangedEventHandler PropertyChanged;
- protected virtual void OnPropertyChanged(string propName)
- {
- if (this.PropertyChanged != null)
- {
- this.PropertyChanged(this, new PropertyChangedEventArgs(propName));
- }
- }
-}
-
-````
-````VB.NET
-Private Class Model
- Implements INotifyPropertyChanged
- Private m_id As Integer
- Private m_selected As Boolean
- Private m_name As String
- Public Property Id() As Integer
- Get
- Return Me.m_id
- End Get
- Set(value As Integer)
- Me.m_id = value
- Me.OnPropertyChanged("Id")
- End Set
- End Property
- Public Property Selected() As Boolean
- Get
- Return Me.m_selected
- End Get
- Set(value As Boolean)
- Me.m_selected = value
- Me.OnPropertyChanged("Selected")
- End Set
- End Property
- Public Property Name() As String
- Get
- Return Me.m_name
- End Get
- Set(value As String)
- Me.m_name = value
- Me.OnPropertyChanged("Name")
- End Set
- End Property
- Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
- Protected Overridable Sub OnPropertyChanged(propName As String)
- RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
- End Sub
-End Class
-
-````
-
-{{endregion}}
+
+
+
+
Now drag a __RadCheckedDropDownList__ to the form and a __RadButton__. The button will be used to check a random item in our data source. In order to bind __RadCheckedDropDownList__ we must assign it a __BindingList__ filled with items and set its *Checked*, *Display* and *Value* members:
#### Model
-{{source=..\SamplesCS\DropDownListControl\CheckedDropDownList\DataBinding1.cs region=DataAndBinding}}
-{{source=..\SamplesVB\DropDownListControl\CheckedDropDownList\DataBinding1.vb region=DataAndBinding}}
-
-````C#
-private BindingList dataSource = new BindingList();
-private Random rnd = new Random();
-public DataBinding1()
-{
- InitializeComponent();
- this.radCheckedDropDownList1.CheckedMember = "Selected";
- this.radCheckedDropDownList1.DisplayMember = "Name";
- this.radCheckedDropDownList1.ValueMember = "Id";
- for (int i = 0; i < 15; i++)
- {
- dataSource.Add(new Model
- {
- Id = i,
- Name = "Item " + i
- });
- }
- this.radCheckedDropDownList1.DataSource = this.dataSource;
- this.radButton1.Text = "Toggle Random Item";
- this.radButton1.Click += radButton1_Click;
-}
-void radButton1_Click(object sender, EventArgs e)
-{
- int index = rnd.Next(0, dataSource.Count);
- Model item = this.dataSource[index];
- item.Selected = !item.Selected;
-}
-
-````
-````VB.NET
-Private dataSource As New BindingList(Of Model)()
-Private rnd As New Random()
-Public Sub New()
- InitializeComponent()
- Me.RadCheckedDropDownList1.CheckedMember = "Selected"
- Me.RadCheckedDropDownList1.DisplayMember = "Name"
- Me.RadCheckedDropDownList1.ValueMember = "Id"
- For i As Integer = 0 To 14
- dataSource.Add(New Model() With { _
- .Id = i, _
- .Name = "Item " & i _
- })
- Next
- Me.RadCheckedDropDownList1.DataSource = Me.dataSource
- Me.radButton1.Text = "Toggle Random Item"
- AddHandler Me.radButton1.Click, AddressOf radButton1_Click
-End Sub
-Private Sub radButton1_Click(sender As Object, e As EventArgs)
- Dim index As Integer = rnd.[Next](0, dataSource.Count)
- Dim item As Model = Me.dataSource(index)
- item.Selected = Not item.Selected
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
>caption Figure 4: RadCheckedDropDownList bound at Run time
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/animation-effects.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/animation-effects.md
index 75961c2f6..605e62b78 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/animation-effects.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/animation-effects.md
@@ -27,23 +27,10 @@ Three properties define the animation behavior of __RadDropDownList__:
#### Animation Settings
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListAnimation.cs region=SetAnimation}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListAnimation.vb region=SetAnimation}}
+
+
-````C#
-this.radDropDownList1.DropDownAnimationEnabled = true;
-this.radDropDownList1.DropDownAnimationFrames = 50;
-this.radDropDownList1.DropDownAnimationEasing = RadEasingType.OutSine;
-````
-````VB.NET
-Me.radDropDownList1.DropDownAnimationEnabled = True
-Me.radDropDownList1.DropDownAnimationFrames = 50
-Me.radDropDownList1.DropDownAnimationEasing = RadEasingType.OutSine
-
-````
-
-{{endregion}}
# See Also
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/custom-items.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/custom-items.md
index 93ac9917e..dc3c9c607 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/custom-items.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/custom-items.md
@@ -25,258 +25,26 @@ This article demonstrates how to display detailed information for each employee
#### Custom RadListVisualItem
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListCustomItems.cs region=CustomVisualItem}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListCustomItems.vb region=CustomVisualItem}}
+
+
-````C#
-
-public class CustomVisualItem : RadListVisualItem
-{
- Font boldFont = new Font("Arial",10f, FontStyle.Bold);
- Font italicFont = new Font("Arial",10f, FontStyle.Italic);
- DockLayoutPanel mainContainer;
- StackLayoutElement leftColumn;
- StackLayoutElement rightColumn;
- LightVisualElement titleElement;
- LightVisualElement photoElement;
- LightVisualElement nameElement;
- LightVisualElement addressElement;
- LightVisualElement phoneElement;
-
- protected override Type ThemeEffectiveType
- {
- get
- {
- return typeof(RadListVisualItem);
- }
- }
-
- protected override void CreateChildElements()
- {
- base.CreateChildElements();
-
- mainContainer = new DockLayoutPanel();
- leftColumn = new StackLayoutElement();
- rightColumn = new StackLayoutElement();
- titleElement = new LightVisualElement();
- photoElement = new LightVisualElement();
- nameElement = new LightVisualElement();
- addressElement = new LightVisualElement();
- phoneElement = new LightVisualElement();
-
- this.Children.Add(mainContainer);
- mainContainer.LastChildFill = true;
-
- leftColumn.Orientation = Orientation.Vertical;
- leftColumn.Children.Add(photoElement);
- photoElement.DrawBorder = true;
-
- rightColumn.Orientation = Orientation.Vertical;
- rightColumn.Children.Add(nameElement);
- nameElement.Font = boldFont;
- rightColumn.Children.Add(addressElement);
- rightColumn.Children.Add(phoneElement);
- rightColumn.Children.Add(titleElement);
- titleElement.DrawBorder = true;
- titleElement.Font = italicFont;
- titleElement.BorderBoxStyle = Telerik.WinControls.BorderBoxStyle.FourBorders;
- titleElement.BorderLeftWidth = 0;
- titleElement.BorderTopWidth = 1;
- titleElement.BorderRightWidth = 0;
- titleElement.BorderBottomWidth = 0;
-
- mainContainer.Children.Add(leftColumn);
- mainContainer.Children.Add(rightColumn);
- DockLayoutPanel.SetDock(leftColumn, Telerik.WinControls.Layouts.Dock.Left);
- DockLayoutPanel.SetDock(rightColumn, Telerik.WinControls.Layouts.Dock.Right);
- leftColumn.NotifyParentOnMouseInput = true;
- rightColumn.NotifyParentOnMouseInput = true;
- titleElement.NotifyParentOnMouseInput = true;
- photoElement.NotifyParentOnMouseInput = true;
- nameElement.NotifyParentOnMouseInput = true;
- addressElement.NotifyParentOnMouseInput = true;
- phoneElement.NotifyParentOnMouseInput = true;
- }
-
- public override void Synchronize()
- {
- base.Synchronize();
- this.Text = string.Empty;
- DataRowView rowView = this.Data.DataBoundItem as DataRowView;
- if (rowView != null)
- {
- this.photoElement.Image = GetImageFromData(rowView.Row["Photo"] as byte[]);
- this.titleElement.Text = rowView.Row["Title"].ToString();
- this.nameElement.Text = rowView.Row["FirstName"].ToString() + " " + rowView.Row["LastName"].ToString();
- this.addressElement.Text = "Address: " + rowView.Row["Address"].ToString().Replace(System.Environment.NewLine, " ");
- this.phoneElement.Text = "Phone: " + rowView.Row["HomePhone"].ToString();
- }
- }
-
- private Image GetImageFromData(byte[] imageData)
- {
- const int OleHeaderLength = 78;
- MemoryStream memoryStream = new MemoryStream();
- if (HasOleContainerHeader(imageData))
- {
- memoryStream.Write(imageData, OleHeaderLength, imageData.Length - OleHeaderLength);
- }
- else
- {
- memoryStream.Write(imageData, 0, imageData.Length);
- }
- Bitmap bitmap = new Bitmap(memoryStream);
- return bitmap.GetThumbnailImage(55, 65, null, new IntPtr());
- }
-
- private bool HasOleContainerHeader(byte[] imageByteArray)
- {
- const byte OleByte0 = 21;
- const byte OleByte1 = 28;
- return (imageByteArray[0] == OleByte0) && (imageByteArray[1] == OleByte1);
- }
-}
-````
-````VB.NET
-
-Public Class CustomVisualItem
-Inherits RadListVisualItem
- Private boldFont As Font
- Private italicFont As Font
- Private mainContainer As DockLayoutPanel
- Private leftColumn As StackLayoutElement
- Private rightColumn As StackLayoutElement
- Private titleElement As LightVisualElement
- Private photoElement As LightVisualElement
- Private nameElement As LightVisualElement
- Private addressElement As LightVisualElement
- Private phoneElement As LightVisualElement
- Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
- Get
- Return GetType(RadListVisualItem)
- End Get
- End Property
- Protected Overrides Sub CreateChildElements()
- MyBase.CreateChildElements()
- boldFont = New Font("Arial", 10.0F, FontStyle.Bold)
- italicFont = New Font("Arial", 10.0F, FontStyle.Italic)
- mainContainer = New DockLayoutPanel()
- leftColumn = New StackLayoutElement()
- rightColumn = New StackLayoutElement()
- titleElement = New LightVisualElement()
- photoElement = New LightVisualElement()
- nameElement = New LightVisualElement()
- addressElement = New LightVisualElement()
- phoneElement = New LightVisualElement()
- Me.Children.Add(mainContainer)
- mainContainer.LastChildFill = True
- leftColumn.Orientation = Orientation.Vertical
- leftColumn.Children.Add(photoElement)
- photoElement.DrawBorder = True
- rightColumn.Orientation = Orientation.Vertical
- rightColumn.Children.Add(nameElement)
- nameElement.Font = boldFont
- rightColumn.Children.Add(addressElement)
- rightColumn.Children.Add(phoneElement)
- rightColumn.Children.Add(titleElement)
- titleElement.DrawBorder = True
- titleElement.Font = italicFont
- titleElement.BorderBoxStyle = Telerik.WinControls.BorderBoxStyle.FourBorders
- titleElement.BorderLeftWidth = 0
- titleElement.BorderTopWidth = 1
- titleElement.BorderRightWidth = 0
- titleElement.BorderBottomWidth = 0
- mainContainer.Children.Add(leftColumn)
- mainContainer.Children.Add(rightColumn)
- DockLayoutPanel.SetDock(leftColumn, Telerik.WinControls.Layouts.Dock.Left)
- DockLayoutPanel.SetDock(rightColumn, Telerik.WinControls.Layouts.Dock.Right)
- leftColumn.NotifyParentOnMouseInput = True
- rightColumn.NotifyParentOnMouseInput = True
- titleElement.NotifyParentOnMouseInput = True
- photoElement.NotifyParentOnMouseInput = True
- nameElement.NotifyParentOnMouseInput = True
- addressElement.NotifyParentOnMouseInput = True
- phoneElement.NotifyParentOnMouseInput = True
- End Sub
- Public Overrides Sub Synchronize()
- MyBase.Synchronize()
- Me.Text = String.Empty
- Dim rowView As DataRowView = TryCast(Me.Data.DataBoundItem, DataRowView)
- If rowView IsNot Nothing Then
- Me.photoElement.Image = GetImageFromData(TryCast(rowView.Row("Photo"), Byte()))
- Me.titleElement.Text = rowView.Row("Title").ToString()
- Me.nameElement.Text = rowView.Row("FirstName").ToString() & " " & rowView.Row("LastName").ToString()
- Me.addressElement.Text = "Address: " & rowView.Row("Address").ToString().Replace(System.Environment.NewLine, " ")
- Me.phoneElement.Text = "Phone: " & rowView.Row("HomePhone").ToString()
- End If
- End Sub
- Private Function GetImageFromData(imageData As Byte()) As Image
- Const OleHeaderLength As Integer = 78
- Dim memoryStream As New MemoryStream()
- If HasOleContainerHeader(imageData) Then
- memoryStream.Write(imageData, OleHeaderLength, imageData.Length - OleHeaderLength)
- Else
- memoryStream.Write(imageData, 0, imageData.Length)
- End If
- Dim bitmap As New Bitmap(memoryStream)
- Return bitmap.GetThumbnailImage(55, 65, Nothing, New IntPtr())
- End Function
- Private Function HasOleContainerHeader(imageByteArray As Byte()) As Boolean
- Const OleByte0 As Byte = 21
- Const OleByte1 As Byte = 28
- Return (imageByteArray(0) = OleByte0) AndAlso (imageByteArray(1) = OleByte1)
- End Function
-End Class
-
-````
-
-{{endregion}}
3\. Subscribe to the __CreatingVisualListItem__ event before populating the __RadDropDownList__ with data and replace the default item with your custom one:
#### Custom RadListVisualItem
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListCustomItems.cs region=ReplaceItem}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListCustomItems.vb region=ReplaceItem}}
+
+
-````C#
-
-private void radDropDownList1_CreatingVisualListItem(object sender, Telerik.WinControls.UI.CreatingVisualListItemEventArgs args)
-{
- args.VisualItem = new CustomVisualItem();
-}
-````
-````VB.NET
-Private Sub radDropDownList1_CreatingVisualListItem(sender As Object, args As Telerik.WinControls.UI.CreatingVisualListItemEventArgs)
- args.VisualItem = New CustomVisualItem()
-End Sub
-````
-
-{{endregion}}
-
4\. The last thing we need to do is to set the RadDropDownList.__AutoSizeItems__ property to *false* and specify the __ItemHeight__:
#### Custom RadListVisualItem
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListCustomItems.cs region=AdjustHeight}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListCustomItems.vb region=AdjustHeight}}
-
-````C#
-
-this.radDropDownList1.AutoSizeItems = false;
-this.radDropDownList1.DropDownListElement.ListElement.ItemHeight = 90;
-
-````
-````VB.NET
-Me.RadDropDownList1.AutoSizeItems = False
-Me.RadDropDownList1.DropDownListElement.ListElement.ItemHeight = 90
-
-````
-
-{{endregion}}
+
+
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/customizing-appearance/accessing-and-customizing-elements.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/customizing-appearance/accessing-and-customizing-elements.md
index 34b9bf535..f3b1d2e03 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/customizing-appearance/accessing-and-customizing-elements.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/customizing-appearance/accessing-and-customizing-elements.md
@@ -32,21 +32,9 @@ You can customize the nested elements at run time as well:
#### Customize elements
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=CustomizeElements}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=CustomizeElements}}
+
+
-````C#
-
-this.radDropDownList1.DropDownListElement.ArrowButton.Fill.BackColor = Color.Aqua;
-this.radDropDownList1.DropDownListElement.EditableElement.ForeColor = Color.Red;
-````
-````VB.NET
-Me.radDropDownList1.DropDownListElement.ArrowButton.Fill.BackColor = Color.Aqua
-Me.radDropDownList1.DropDownListElement.EditableElement.ForeColor = Color.Red
-````
-
-{{endregion}}
-
In order to style the pop-up items it is suitable to use the [VisualItemFormatting]({%slug winforms/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/formatting-items%}) event.
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/customizing-appearance/formatting-items.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/customizing-appearance/formatting-items.md
index 2d683bfe4..05621fc0a 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/customizing-appearance/formatting-items.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/customizing-appearance/formatting-items.md
@@ -24,44 +24,10 @@ Items appearance in __RadDropDownList__ can be customized by making use of the _
#### Customize selected item appearance
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListCustomizeItems.cs region=CustomizeItems}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListCustomizeItems.vb region=CustomizeItems}}
-
-````C#
-private void radDropDownList1_VisualListItemFormatting(object sender, VisualItemFormattingEventArgs args)
-{
- if (args.VisualItem.Selected)
- {
- args.VisualItem.NumberOfColors = 1;
- args.VisualItem.BackColor = Color.Yellow;
- args.VisualItem.BorderColor = Color.Blue;
- }
- else
- {
- args.VisualItem.ResetValue(LightVisualElement.NumberOfColorsProperty, Telerik.WinControls.ValueResetFlags.Local);
- args.VisualItem.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local);
- args.VisualItem.ResetValue(LightVisualElement.BorderColorProperty, Telerik.WinControls.ValueResetFlags.Local);
- }
-}
-
-````
-````VB.NET
-Private Sub radDropDownList1_VisualListItemFormatting(sender As Object, args As VisualItemFormattingEventArgs)
- If args.VisualItem.Selected Then
- args.VisualItem.NumberOfColors = 1
- args.VisualItem.BackColor = Color.Yellow
- args.VisualItem.BorderColor = Color.Blue
- Else
- args.VisualItem.ResetValue(LightVisualElement.NumberOfColorsProperty, Telerik.WinControls.ValueResetFlags.Local)
- args.VisualItem.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local)
- args.VisualItem.ResetValue(LightVisualElement.BorderColorProperty, Telerik.WinControls.ValueResetFlags.Local)
- End If
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
## Customizing auto-complete drop-down appearance
@@ -69,42 +35,18 @@ In order to customize the auto complete pop-up, you should subscribe to the __Vi
#### Subscribe to the VisualItemFormatting event of the auto complete popup
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListCustomizeItems.cs region=Event}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListCustomizeItems.vb region=Event}}
-````C#
-radDropDownList1.DropDownListElement.AutoCompleteSuggest.DropDownList.ListElement.VisualItemFormatting += new VisualListItemFormattingEventHandler(ListElement_VisualItemFormatting);
+
+
-````
-````VB.NET
-AddHandler RadDropDownList1.DropDownListElement.AutoCompleteSuggest.DropDownList.ListElement.VisualItemFormatting, AddressOf ListElement_VisualItemFormatting
-````
-
-{{endregion}}
The following code snippet, will demonstrate how to change the Font of all items in the auto complete drop down.
#### Customize auto complete items appearance
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListCustomizeItems.cs region=CustomizeAutoCompleteDropDown}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListCustomizeItems.vb region=CustomizeAutoCompleteDropDown}}
-````C#
-Font myFont = new Font("Segoe UI", 14, FontStyle.Bold);
-private void ListElement_VisualItemFormatting(object sender, VisualItemFormattingEventArgs args)
-{
- args.VisualItem.Font = myFont;
-}
-
-````
-````VB.NET
-Private myFont As New Font("Segoe UI", 14, FontStyle.Bold)
-Private Sub ListElement_VisualItemFormatting(sender As Object, args As VisualItemFormattingEventArgs)
- args.VisualItem.Font = myFont
-End Sub
-
-````
-
-{{endregion}}
+
+
+
>note Here we do not reset the style because we do want the Font for all items to be changed not only on certain one.
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/dropdown-resizing.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/dropdown-resizing.md
index 2e986931a..52f645671 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/dropdown-resizing.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/dropdown-resizing.md
@@ -25,21 +25,13 @@ The __SizingMode__ enumeration has the following members:

-#### SizingMode.None
+#### SizingMode.None
+
+
+
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListItemSizing.cs region=None}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListItemSizing.vb region=None}}
-````C#
-this.radDropDownList1.DropDownSizingMode = SizingMode.None;
-````
-````VB.NET
-Me.radDropDownList1.DropDownSizingMode = SizingMode.None
-
-````
-
-{{endregion}}
* __RightBottom__: allows sizing in horizontal direction.
@@ -47,21 +39,13 @@ Me.radDropDownList1.DropDownSizingMode = SizingMode.None

-#### SizingMode.RightBottom
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListItemSizing.cs region=RightBottom}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListItemSizing.vb region=RightBottom}}
+#### SizingMode.RightBottom
+
+
+
-````C#
-this.radDropDownList1.DropDownSizingMode = SizingMode.RightBottom;
-````
-````VB.NET
-Me.radDropDownList1.DropDownSizingMode = SizingMode.RightBottom
-````
-
-{{endregion}}
* __UpDown__: allows sizing in vertical direction.
@@ -70,21 +54,13 @@ Me.radDropDownList1.DropDownSizingMode = SizingMode.RightBottom

-#### SizingMode.UpDown
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListItemSizing.cs region=UpDown}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListItemSizing.vb region=UpDown}}
+#### SizingMode.UpDown
+
+
+
-````C#
-this.radDropDownList1.DropDownSizingMode = SizingMode.UpDown;
-````
-````VB.NET
-Me.radDropDownList1.DropDownSizingMode = SizingMode.UpDown
-````
-
-{{endregion}}
* __UpDownAndRightBottom__: allows sizing in both directions.
@@ -93,21 +69,13 @@ Me.radDropDownList1.DropDownSizingMode = SizingMode.UpDown

-#### SizingMode.UpDownAndRightBottom
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListItemSizing.cs region=UpDownAndRightBottom}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListItemSizing.vb region=UpDownAndRightBottom}}
-
-````C#
-this.radDropDownList1.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
+#### SizingMode.UpDownAndRightBottom
+
+
+
-````
-````VB.NET
-Me.radDropDownList1.DropDownSizingMode = SizingMode.UpDownAndRightBottom
-````
-{{endregion}}
## Fixed size
@@ -118,41 +86,25 @@ You can specify a fixed height or width of the drop-down by setting the __DropDo

-#### DropDownHeight
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListItemSizing.cs region=DropDownHeight}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListItemSizing.vb region=DropDownHeight}}
-
-````C#
-this.radDropDownList1.DropDownListElement.DropDownHeight = 400;
+#### DropDownHeight
+
+
+
-````
-````VB.NET
-Me.radDropDownList1.DropDownListElement.DropDownHeight = 400
-````
-{{endregion}}
>caption Figure 6: DropDownWidth

-#### DropDownWidth
+#### DropDownWidth
+
+
+
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListItemSizing.cs region=DropDownWidth}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListItemSizing.vb region=DropDownWidth}}
-````C#
-this.radDropDownList1.DropDownListElement.DropDownWidth = 400;
-````
-````VB.NET
-Me.radDropDownList1.DropDownListElement.DropDownWidth = 400
-
-````
-
-{{endregion}}
You can set the __DropDownMinSize__ property in order to specify the exact minimum height and width for the drop-down.
@@ -161,73 +113,23 @@ You can set the __DropDownMinSize__ property in order to specify the exact minim

-#### DropDownMinSize
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListItemSizing.cs region=DropDownMinSize}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListItemSizing.vb region=DropDownMinSize}}
-
-````C#
-this.radDropDownList1.DropDownMinSize = new Size(400, 400);
-
-````
-````VB.NET
-Me.radDropDownList1.DropDownMinSize = New Size(400, 400)
+#### DropDownMinSize
+
+
+
-````
-{{endregion}}
## Auto size
The following example demonstrates a sample approach how to handle the RadDropDownList.__PopupOpening__ event and achieve auto size functionality for the pop up in __RadDropDownList__:
-#### Auto size drop down
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=AutoSizeDropDown}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=AutoSizeDropDown}}
-
-````C#
-private void RadDropDownList1_PopupOpening(object sender, CancelEventArgs e)
-{
- RadDropDownListElement list = sender as RadDropDownListElement;
- float width = 0;
- for (int x = 0; x < list.Items.Count(); x++)
- {
- width = Math.Max(width, TextRenderer.MeasureText(list.Items[x].Text, list.Font).Width);
- }
- if (list.Items.Count * (list.ItemHeight-1) > list.DropDownHeight)
- {
- width += list.ListElement.VScrollBar.Size.Width;
- }
- list.Popup.Width = (int)width;
-}
-
-````
-````VB.NET
-Private Sub RadDropDownList1_PopupOpening(sender As Object, e As CancelEventArgs)
- Dim list As RadDropDownListElement = TryCast(sender, RadDropDownListElement)
- Dim width As Single = 0
- For x As Integer = 0 To list.Items.Count() - 1
- width = Math.Max(width, TextRenderer.MeasureText(list.Items(x).Text, list.Font).Width)
- Next
- If list.Items.Count * (list.ItemHeight - 1) > list.DropDownHeight Then
- width += list.ListElement.VScrollBar.Size.Width
- End If
- list.Popup.Width = CInt(width)
-End Sub
-'#End Region
-'#Region "FilteringPredicate"
-Private Function FilterItem(item As RadListDataItem) As Boolean
- If item.Text.StartsWith("L") Then
- Return True
- End If
-
- Return False
-End Function
-
-````
-
-{{endregion}}
+#### Auto size drop down
+
+
+
+
+
|Default pop up size|Auto sized popup|
|----|----|
@@ -241,21 +143,12 @@ By default, __RadDropDownList__ displays 6 items in the pop-up. In case you need

-#### DefaultItemsCountInDropDown
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListItemSizing.cs region=DefaultItemsCountInDropDown}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListItemSizing.vb region=DefaultItemsCountInDropDown}}
-
-````C#
-this.radDropDownList1.DropDownListElement.DefaultItemsCountInDropDown = 3;
-
-````
-````VB.NET
-Me.radDropDownList1.DropDownListElement.DefaultItemsCountInDropDown = 3
+#### DefaultItemsCountInDropDown
+
+
+
-````
-{{endregion}}
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/dropdownstyle.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/dropdownstyle.md
index 869c07be0..ef6d461b3 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/dropdownstyle.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/dropdownstyle.md
@@ -23,41 +23,19 @@ The __RadDropDownList.DropDownStyle__ property determines if the text area at th
#### Setting DropDownStyle
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=dropDownStyle}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=dropDownStyle}}
+
+
-````C#
-
-this.radDropDownList1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
-````
-````VB.NET
-Me.radDropDownList1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown
-
-````
-
-{{endregion}}
When __RadDropDownList__ is set to *RadDropDownStyle.DropDownList* one can control if an image will be displayed in the editor:
#### Image in Editor
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=ImageInEditor}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=ImageInEditor}}
-
-````C#
-this.radDropDownList1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
-this.radDropDownList1.ShowImageInEditorArea = false;
-
-````
-````VB.NET
-Me.radDropDownList1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList
-Me.radDropDownList1.ShowImageInEditorArea = False
+
+
-````
-{{endregion}}
-
## User Defined Values
@@ -69,83 +47,19 @@ This section describes how user defined values can be added to the data source p
#### Initial Set Up
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListUserDefinedValues.cs region=InitialSetUp}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListUserDefinedValues.vb region=InitialSetUp}}
-
-````C#
-private BindingList data;
-public DropDownListUserDefinedValues()
-{
- InitializeComponent();
- this.data = new BindingList();
- this.data.Add("Sofia");
- this.data.Add("New York");
- this.data.Add("Delhi");
- this.data.Add("Tokyo");
- this.data.Add("Berlin");
- this.data.Add("Moscow");
- this.data.Add("Beijing");
- this.data.Add("Bern");
- this.data.Add("Paris");
- this.data.Add("London");
- this.radDropDownList1.DataSource = this.data;
- this.radDropDownList1.KeyUp += radDropDownList1_KeyUp;
-}
-
-````
-````VB.NET
-Private data As BindingList(Of String)
-Public Sub New()
- InitializeComponent()
- Me.data = New BindingList(Of String)()
- Me.data.Add("Sofia")
- Me.data.Add("New York")
- Me.data.Add("Delhi")
- Me.data.Add("Tokyo")
- Me.data.Add("Berlin")
- Me.data.Add("Moscow")
- Me.data.Add("Beijing")
- Me.data.Add("Bern")
- Me.data.Add("Paris")
- Me.data.Add("London")
- Me.RadDropDownList1.DataSource = Me.data
- AddHandler Me.RadDropDownList1.KeyUp, AddressOf RadDropDownList1_KeyUp
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
Now we need to handle the event, perform the required checks and update our data source.
#### Initial Set Up
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListUserDefinedValues.cs region=HandleEvent}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListUserDefinedValues.vb region=HandleEvent}}
-
-````C#
-private void radDropDownList1_KeyUp(object sender, KeyEventArgs e)
-{
- string result = this.radDropDownList1.DropDownListElement.Text;
- if (e.KeyCode == Keys.Enter && !this.data.Contains(result))
- {
- this.data.Insert(0, result);
- }
-}
-
-````
-````VB.NET
-Private Sub RadDropDownList1_KeyUp(sender As Object, e As KeyEventArgs)
- Dim result As String = Me.RadDropDownList1.DropDownListElement.Text
- If e.KeyCode = Keys.Enter AndAlso Not Me.data.Contains(result) Then
- Me.data.Insert(0, result)
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
# See Also
* [Indicating Focus in RadDropDownList]({%slug dropdownlist-style-indicating-focus%})
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/auto-complete.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/auto-complete.md
index d5494457a..403ba6dac 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/auto-complete.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/auto-complete.md
@@ -27,41 +27,22 @@ The RadDropDownList.__AutoCompleteMode__ property controls auto-complete behavio

-#### AutoCompleteMode.None
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=autoCNone}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=autoCNone}}
-
-````C#
-
-this.radDropDownList1.AutoCompleteMode = AutoCompleteMode.None;
+#### AutoCompleteMode.None
+
+
+
-````
-````VB.NET
-Me.radDropDownList1.AutoCompleteMode = AutoCompleteMode.None
-````
-{{endregion}}
* __Suggest__: As the user types an entry into the text box, the drop-down part of the control is shown, and the displayed items are filtered according to the entered text.
-#### AutoCompleteMode.Suggest
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=autoCSuggest}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=autoCSuggest}}
-
-````C#
-
-this.radDropDownList1.AutoCompleteMode = AutoCompleteMode.Suggest;
+#### AutoCompleteMode.Suggest
+
+
+
-````
-````VB.NET
-Me.radDropDownList1.AutoCompleteMode = AutoCompleteMode.Suggest
-````
-
-{{endregion}}
>caption Figure 2: AutoCompleteMode.Suggest
@@ -73,41 +54,22 @@ Me.radDropDownList1.AutoCompleteMode = AutoCompleteMode.Suggest

-#### AutoCompleteMode.Append
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=autoCAppend}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=autoCAppend}}
+#### AutoCompleteMode.Append
+
+
+
-````C#
-
-this.radDropDownList1.AutoCompleteMode = AutoCompleteMode.Append;
-````
-````VB.NET
-Me.radDropDownList1.AutoCompleteMode = AutoCompleteMode.Append
-````
-
-{{endregion}}
* __SuggestAppend__: Similar to the Append setting, but the drop-down list is shown and the suggested item is highlighted.
-#### AutoCompleteMode.SuggestAppend
+#### AutoCompleteMode.SuggestAppend
+
+
+
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=autoCSuggestAppend}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=autoCSuggestAppend}}
-````C#
-
-this.radDropDownList1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
-
-````
-````VB.NET
-Me.radDropDownList1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
-
-````
-
-{{endregion}}
>caption Figure 4: AutoCompleteMode.SuggestAppend
@@ -122,21 +84,12 @@ __RadDropDownList__ internally uses auto-complete helpers to perform the auto-co
* __SuggestMode__: determines whether the items are auto-completed considering whether the text starts with or contains the searched text.
-#### SuggestMode.Contains
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=autoCsuggestMode}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=autoCsuggestMode}}
-
-````C#
-this.radDropDownList1.DropDownListElement.AutoCompleteSuggest.SuggestMode = Telerik.WinControls.UI.SuggestMode.Contains;
+#### SuggestMode.Contains
+
+
+
-````
-````VB.NET
-Me.radDropDownList1.DropDownListElement.AutoCompleteSuggest.SuggestMode = Telerik.WinControls.UI.SuggestMode.Contains
-````
-
-{{endregion}}
>caption Figure 5: SuggestMode.Contains
@@ -151,88 +104,24 @@ Me.radDropDownList1.DropDownListElement.AutoCompleteSuggest.SuggestMode = Teleri
\* __AutoCompleteAppendHelper__: it is created when the __AutoCompleteMode__ property is set to AutoCompleteMode.*Append* or AutoCompleteMode.*SuggestAppend*. The __LimitToList__ property controls whether the user is blocked to enter invalid string in the editable part.
-#### Limit the user to enter only valid values
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=autoClimitToList}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=autoClimitToList}}
-
-````C#
-this.radDropDownList1.DropDownListElement.AutoCompleteAppend.LimitToList = true;
+#### Limit the user to enter only valid values
+
+
+
-````
-````VB.NET
-Me.radDropDownList1.DropDownListElement.AutoCompleteAppend.LimitToList = True
-````
-{{endregion}}
## Customize auto-complete helpers
By default, the items displayed in the __AutoCompleteSuggestHelper__’s pop-up are sorted alphabetically. The following example demonstrates how to manipulate the sort order considering the item’s Text.__Length__ property:
-#### Custom comparer
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=CustomComparer}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=CustomComparer}}
-
-````C#
-
-public void ApplyComparer()
-{
- this.radDropDownList1.AutoCompleteMode = AutoCompleteMode.Suggest;
- this.radDropDownList1.DropDownListElement.AutoCompleteSuggest = new CustomAutoCompleteSuggestHelper(this.radDropDownList1.DropDownListElement);
- this.radDropDownList1.DropDownListElement.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains;
-}
-
-public class CustomAutoCompleteSuggestHelper : AutoCompleteSuggestHelper
-{
- public CustomAutoCompleteSuggestHelper(RadDropDownListElement owner) : base(owner)
- {
- }
-
- public override void ApplyFilterToDropDown(string filter)
- {
- base.ApplyFilterToDropDown(filter);
- this.DropDownList.ListElement.DataLayer.DataView.Comparer = new CustomComparer();
- }
-}
-
-public class CustomComparer: IComparer
-{
- public int Compare(RadListDataItem x, RadListDataItem y)
- {
- return x.Text.Length.CompareTo(y.Text.Length);
- }
-}
-
-````
-````VB.NET
-Public Sub ApplyComparer()
- Me.radDropDownList1.AutoCompleteMode = AutoCompleteMode.Suggest
- Me.radDropDownList1.DropDownListElement.AutoCompleteSuggest = New CustomAutoCompleteSuggestHelper(Me.radDropDownList1.DropDownListElement)
- Me.radDropDownList1.DropDownListElement.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains
-End Sub
-Public Class CustomAutoCompleteSuggestHelper
- Inherits AutoCompleteSuggestHelper
- Public Sub New(owner As RadDropDownListElement)
- MyBase.New(owner)
- End Sub
- Public Overrides Sub ApplyFilterToDropDown(filter As String)
- MyBase.ApplyFilterToDropDown(filter)
- Me.DropDownList.ListElement.DataLayer.DataView.Comparer = New CustomComparer()
- End Sub
-End Class
-Public Class CustomComparer
- Implements IComparer(Of RadListDataItem)
- Public Function [Compare](x As RadListDataItem, y As RadListDataItem) As Integer Implements IComparer(Of RadListDataItem).[Compare]
- Return x.Text.Length.CompareTo(y.Text.Length)
- End Function
-End Class
-
-````
-
-{{endregion}}
+#### Custom comparer
+
+
+
+
+
>caption Figure 6: Custom comparer
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/filtering.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/filtering.md
index 8cfabe62a..4fed25d28 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/filtering.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/filtering.md
@@ -15,48 +15,17 @@ __RadDropDownList__ supports filtering of its items. In order to apply a filter,
#### Filter
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=Filter}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=Filter}}
-````C#
-
-this.radDropDownList1.Filter = FilterItem;
+
+
-````
-````VB.NET
-Me.radDropDownList1.Filter = AddressOf FilterItem
-
-````
-
-{{endregion}}
+
#### Filtering predicate
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=FilteringPredicate}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=FilteringPredicate}}
-````C#
-
-private bool FilterItem(RadListDataItem item)
-{
- if (item.Text.StartsWith("L"))
- {
- return true;
- }
- return false;
-}
-
-````
-````VB.NET
-Private Function FilterItem(item As RadListDataItem) As Boolean
- If item.Text.StartsWith("L") Then
- Return True
- End If
-
- Return False
-End Function
-
-````
-
-{{endregion}}
+
+
+
+
If you apply the above filter to a __RadDropDownList__ that is bound to the Northwind.__Customers__ table you will obtain the following result:
@@ -69,18 +38,10 @@ Another option to filter the items is to specify the __FilterExpression__ proper
#### FilteringExpression
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=FilteringExpression}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=FilteringExpression}}
-````C#
-this.radDropDownList1.FilterExpression = "Country LIKE 'Argentina'";
-
-````
-````VB.NET
-Me.radDropDownList1.FilterExpression = "Country LIKE 'Argentina'"
+
+
-````
-
-{{endregion}}
+
>caption Figure 2: FilteringExpression
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/scrolling.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/scrolling.md
index 6e389a23e..735b42620 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/scrolling.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/scrolling.md
@@ -23,19 +23,10 @@ This feature ensures that the control is ready for modern touch-screen applicati
#### Enabling Kinetic Scrolling
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListScrolling.cs region=KineticScrolling}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListScrolling.vb region=KineticScrolling}}
+
+
-````C#
-this.radDropDownList1.EnableKineticScrolling = true;
-
-````
-````VB.NET
-Me.RadDropDownList1.EnableKineticScrolling = True
-
-````
-
-{{endregion}}
+
## Programmatically Scrolling
@@ -53,19 +44,10 @@ __RadDropDownList__ provides out of the box functionality for programmatically s
#### Scroll to Item
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListScrolling.cs region=ScrollToItem}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListScrolling.vb region=ScrollToItem}}
-
-````C#
-this.radDropDownList1.DropDownListElement.ListElement.ScrollToItem(this.radDropDownList1.Items.Last());
-
-````
-````VB.NET
-Me.RadDropDownList1.DropDownListElement.ListElement.ScrollToItem(Me.RadDropDownList1.Items.Last())
+
+
-````
-
-{{endregion}}
+
>caption Figure 3: Scroll to Active Item
@@ -74,19 +56,10 @@ Me.RadDropDownList1.DropDownListElement.ListElement.ScrollToItem(Me.RadDropDownL
#### Scroll to Active Item
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListScrolling.cs region=ScrollToActiveItem}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListScrolling.vb region=ScrollToActiveItem}}
-
-````C#
-this.radDropDownList1.DropDownListElement.ListElement.ScrollToActiveItem();
+
+
-````
-````VB.NET
-Me.RadDropDownList1.DropDownListElement.ListElement.ScrollToActiveItem()
-
-````
-
-{{endregion}}
+
## Scrolling Modes
@@ -108,19 +81,10 @@ The __ListElement__ contained in the popup of __RadDropDownList__ supports three
#### Discrete Scrolling
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListScrolling.cs region=DiscreteScrolling}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListScrolling.vb region=DiscreteScrolling}}
+
+
-````C#
-this.radDropDownList1.DropDownListElement.ListElement.ScrollMode = ItemScrollerScrollModes.Discrete;
-
-````
-````VB.NET
-Me.RadDropDownList1.DropDownListElement.ListElement.ScrollMode = ItemScrollerScrollModes.Discrete
-
-````
-
-{{endregion}}
+
>caption Figure 5: Smooth Scrolling
@@ -128,19 +92,10 @@ Me.RadDropDownList1.DropDownListElement.ListElement.ScrollMode = ItemScrollerScr
#### Smooth Scrolling
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListScrolling.cs region=SmoothScrolling}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListScrolling.vb region=SmoothScrolling}}
-
-````C#
-this.radDropDownList1.DropDownListElement.ListElement.ScrollMode = ItemScrollerScrollModes.Smooth;
-
-````
-````VB.NET
-Me.RadDropDownList1.DropDownListElement.ListElement.ScrollMode = ItemScrollerScrollModes.Smooth
+
+
-````
-
-{{endregion}}
+
>caption Figure 6: Deferred Scrolling
@@ -148,19 +103,10 @@ Me.RadDropDownList1.DropDownListElement.ListElement.ScrollMode = ItemScrollerScr
#### Deferred Scrolling
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListScrolling.cs region=DeferredScrolling}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListScrolling.vb region=DeferredScrolling}}
-
-````C#
-this.radDropDownList1.DropDownListElement.ListElement.ScrollMode = ItemScrollerScrollModes.Deferred;
+
+
-````
-````VB.NET
-Me.RadDropDownList1.DropDownListElement.ListElement.ScrollMode = ItemScrollerScrollModes.Deferred
-
-````
-
-{{endregion}}
+
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/selection.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/selection.md
index 10e3f5af5..84b5af885 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/selection.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/selection.md
@@ -30,19 +30,10 @@ __RadDropDownList__ supports three types of selection modes:
#### Setting a Selection Mode
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListSelection.cs region=MultiExtendedSelection}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListSelection.vb region=MultiExtendedSelection}}
+
+
-````C#
-this.radDropDownList1.DropDownListElement.SelectionMode = SelectionMode.MultiExtended;
-
-````
-````VB.NET
-Me.radDropDownList1.DropDownListElement.SelectionMode = SelectionMode.MultiExtended
-
-````
-
-{{endregion}}
+
## Select Next Item
@@ -54,19 +45,10 @@ __RadDropDownList__ can automatically select the next item when a double click i
#### Next Item Selection
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListSelection.cs region=NextItemSelection}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListSelection.vb region=NextItemSelection}}
-
-````C#
-this.radDropDownList1.SelectNextOnDoubleClick = true;
-
-````
-````VB.NET
-Me.radDropDownList1.SelectNextOnDoubleClick = True
-
-````
+
+
-{{endregion}}
+
## Selection Events
@@ -103,21 +85,10 @@ Items can be programmatically selected either by their value or by their logical
>note Setting these properties will result in raising the selection events.
>
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListSelection.cs region=SetSelectedItem}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListSelection.vb region=SetSelectedItem}}
-
-````C#
-
-this.radDropDownList1.SelectedItem = this.radDropDownList1.Items[1];
-
-````
-````VB.NET
+
+
-Me.radDropDownList1.SelectedItem = Me.radDropDownList1.Items(1)
-
-````
-
-{{endregion}}
+
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/sorting.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/sorting.md
index 6a4f28581..096e01cde 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/sorting.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/features/sorting.md
@@ -29,20 +29,10 @@ __RadDropDownList__ supports sorting of its pop-up items. You can control how th
#### SortStyle
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListSorting.cs region=SortStyle}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListSorting.vb region=SortStyle}}
+
+
-````C#
-
-this.radDropDownList1.SortStyle = Telerik.WinControls.Enumerations.SortStyle.Descending;
-
-````
-````VB.NET
-Me.RadDropDownList1.SortStyle = Telerik.WinControls.Enumerations.SortStyle.Descending
-
-````
-
-{{endregion}}
+
## Customizing sort order
@@ -55,69 +45,10 @@ When the __SortStyle__ property is set to *Ascending* or *Descending* you can ma
#### Custom comparer
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListSorting.cs region=CustomComparer}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListSorting.vb region=CustomComparer}}
+
+
-````C#
-
-public DropDownListSorting()
-{
- InitializeComponent();
-
- for (int i = 0; i < 10; i++)
- {
- RadListDataItem item = new RadListDataItem();
- item.Value = 10 - i;
- item.Text = i + ".Item";
- this.radDropDownList1.Items.Add(item);
- }
- this.radDropDownList1.SortStyle = Telerik.WinControls.Enumerations.SortStyle.Ascending;
- this.radDropDownList1.ItemsSortComparer = new CustomComparer();
-}
-
-public class CustomComparer : IComparer
-{
- public int Compare(RadListDataItem x, RadListDataItem y)
- {
- int xId = 0;
- int yId = 0;
- if (int.TryParse(x.Value.ToString(), out xId) && int.TryParse(y.Value.ToString(), out yId))
- {
- return xId.CompareTo(yId);
- }
- return x.Value.ToString().CompareTo(y.Value.ToString());
- }
-}
-
-````
-````VB.NET
-Public Sub New()
- InitializeComponent()
- For i As Integer = 0 To 9
- Dim item As New RadListDataItem()
- item.Value = 10 - i
- item.Text = i & ".Item"
- Me.RadDropDownList1.Items.Add(item)
- Next
- Me.RadDropDownList1.SortStyle = Telerik.WinControls.Enumerations.SortStyle.Ascending
- Me.RadDropDownList1.ItemsSortComparer = New CustomComparer()
-End Sub
-
-Public Class CustomComparer
-Implements IComparer(Of RadListDataItem)
- Public Function [Compare](x As RadListDataItem, y As RadListDataItem) As Integer Implements IComparer(Of RadListDataItem).[Compare]
- Dim xId As Integer = 0
- Dim yId As Integer = 0
- If Integer.TryParse(x.Value.ToString(), xId) AndAlso Integer.TryParse(y.Value.ToString(), yId) Then
- Return xId.CompareTo(yId)
- End If
- Return x.Value.ToString().CompareTo(y.Value.ToString())
- End Function
-End Class
-
-````
-
-{{endregion}}
+
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/getting-started.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/getting-started.md
index 9952d881e..a309cdd9d 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/getting-started.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/getting-started.md
@@ -67,33 +67,11 @@ The following tutorial demonstrates how to add items and images to a __RadDropDo
#### Handling the SelectedIndexChanged event
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=handlingSelectedIndexChanged}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=handlingSelectedIndexChanged}}
-
-````C#
-
-void radDropDownList1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
-{
- if (this.radDropDownList1.SelectedIndex > -1)
- {
- this.radLabelElement1.Text = this.radDropDownList1.SelectedItem.Text;
- this.radImageButtonElement1.Image = this.radDropDownList1.SelectedItem.Image;
- }
-}
-
-````
-````VB.NET
-Private Sub radDropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.Data.PositionChangedEventArgs)
- If Me.radDropDownList1.SelectedIndex > -1 Then
- radLabelElement1.Text = Me.radDropDownList1.SelectedItem.Text
- Me.radImageButtonElement1.Image = Me.radDropDownList1.SelectedItem.Image
- End If
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
+
This is it! Now the change in the selection of the __RadDropDownList__ instance will be reflected on __RadStatusStrip__.
## Telerik UI for WinForms Learning Resources
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/item-sizing.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/item-sizing.md
index 790914ac3..d173b183d 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/item-sizing.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/item-sizing.md
@@ -19,24 +19,13 @@ By default, all items in __RadDropDownList__ have equal height, *18px*. You can

-#### ItemHeight
+#### ItemHeight
+
+
+
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListItemSizing.cs region=ItemHeight}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListItemSizing.vb region=ItemHeight}}
-````C#
-
-this.radDropDownList1.DropDownListElement.ListElement.Font = new Font("Arial", 18f);
-this.radDropDownList1.ListElement.ItemHeight = 40;
-````
-````VB.NET
-Me.RadDropDownList1.DropDownListElement.ListElement.Font = New Font("Arial", 18.0F)
-Me.RadDropDownList1.ListElement.ItemHeight = 40
-
-````
-
-{{endregion}}
## AutoSizeItems
@@ -47,23 +36,12 @@ The RadDropDownList.__AutoSizeItems__ property indicates whether items will be s

-#### AutoSizeItems
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListItemSizing.cs region=AutoSizeItems}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListItemSizing.vb region=AutoSizeItems}}
+#### AutoSizeItems
+
+
+
-````C#
-this.radDropDownList1.DropDownListElement.ListElement.Font = new Font("Arial", 8f);
-this.radDropDownList1.AutoSizeItems = true;
-````
-````VB.NET
-Me.RadDropDownList1.DropDownListElement.ListElement.Font = New Font("Arial", 8.0F)
-Me.RadDropDownList1.AutoSizeItems = True
-
-````
-
-{{endregion}}
If this property is set to *false* the user can set the __Height__ property of each individual __RadListDataItem__ in the __Items__ collection in order to override the automatic sizing.
@@ -72,46 +50,13 @@ If this property is set to *false* the user can set the __Height__ property of e

-#### Height
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListItemSizing.cs region=Height}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListItemSizing.vb region=Height}}
-
-````C#
-
-this.radDropDownList1.AutoSizeItems = false;
-StringBuilder sb;
-for (int i = 0; i < 10; i++)
-{
- RadListDataItem item = new RadListDataItem();
- sb = new StringBuilder();
- for (int j = 0; j < i + 1; j++)
- {
- sb.AppendLine("Item" + i + " Line" + j);
- }
- item.Text = sb.ToString();
- item.Height = this.radDropDownList1.ListElement.ItemHeight * (i + 1);
- this.radDropDownList1.Items.Add(item);
-}
-
-````
-````VB.NET
-Me.RadDropDownList1.AutoSizeItems = False
-Dim sb As StringBuilder
-For i As Integer = 0 To 9
- Dim item As New RadListDataItem()
- sb = New StringBuilder()
- For j As Integer = 0 To i
- sb.AppendLine("Item" & i & " Line" & j)
- Next
- item.Text = sb.ToString()
- item.Height = Me.RadDropDownList1.ListElement.ItemHeight * (i + 1)
- Me.RadDropDownList1.Items.Add(item)
-Next
-
-````
-
-{{endregion}}
+#### Height
+
+
+
+
+
+
## Sizing auto-complete pop-up items
@@ -121,23 +66,12 @@ When the RadDropDownList.__AutoCompleteMode__ property is set to *Suggest* or *S

-#### Auto-complete items height
-
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListItemSizing.cs region=AutoCompleteItemsHeight}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListItemSizing.vb region=AutoCompleteItemsHeight}}
-
-````C#
-this.radDropDownList1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
-this.radDropDownList1.DropDownListElement.AutoCompleteSuggest.DropDownList.ListElement.ItemHeight = 40;
-
-````
-````VB.NET
-Me.RadDropDownList1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
-Me.RadDropDownList1.DropDownListElement.AutoCompleteSuggest.DropDownList.ListElement.ItemHeight = 40
+#### Auto-complete items height
+
+
+
-````
-{{endregion}}
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/populating-with-data/adding-items-programmatically.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/populating-with-data/adding-items-programmatically.md
index b6995b7dd..4d17ed9a7 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/populating-with-data/adding-items-programmatically.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/populating-with-data/adding-items-programmatically.md
@@ -29,37 +29,10 @@ You can use one of the following item types:
#### Add items programmatically
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=AddItemsProgrammatically}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=AddItemsProgrammatically}}
+
+
-````C#
-
-DescriptionTextListDataItem descriptionItem = new DescriptionTextListDataItem();
-descriptionItem.Text = "Chicken wings";
-descriptionItem.Image = Properties.Resources.chicken_wings;
-descriptionItem.DescriptionText = "some description";
-this.radDropDownList1.Items.Add(descriptionItem);
-
-RadListDataItem dataItem = new RadListDataItem();
-dataItem.Text = "Chicken toast";
-dataItem.Image = Properties.Resources.chicken_toast;
-this.radDropDownList1.Items.Add(dataItem);
-
-````
-````VB.NET
-Dim descriptionItem As New DescriptionTextListDataItem()
-descriptionItem.Text = "Chicken wings"
-descriptionItem.Image = My.Resources.chicken_wings
-descriptionItem.DescriptionText = "some description"
-Me.radDropDownList1.Items.Add(descriptionItem)
-Dim dataItem As New RadListDataItem()
-dataItem.Text = "Chicken toast"
-dataItem.Image = My.Resources.chicken_toast
-Me.radDropDownList1.Items.Add(dataItem)
-
-````
-
-{{endregion}}
+
# See Also
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/populating-with-data/data-binding.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/populating-with-data/data-binding.md
index 081606706..0b70b7bd2 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/populating-with-data/data-binding.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/populating-with-data/data-binding.md
@@ -51,75 +51,10 @@ You can bind __RadDropDownList__ programmatically as well. The following code sn
#### Data binding at run time
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownList1.cs region=Binding}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownList1.vb region=Binding}}
-
-````C#
-
-public class Item
-{
- public int Id { get; set; }
-
- public string Description { get; set; }
-
- public Item(int id, string description)
- {
- this.Id = id;
- this.Description = description;
- }
-}
-
-public void Bind()
-{
- List items = new List();
- for (int i = 0; i < 10; i++)
- {
- items.Add(new Item(i,"Data" + i));
- }
- this.radDropDownList1.DataSource = items;
- this.radDropDownList1.DisplayMember = "Description";
- this.radDropDownList1.ValueMember = "Id";
-}
-
-````
-````VB.NET
-Public Class Item
- Public Property Id() As Integer
- Get
- Return m_Id
- End Get
- Set(value As Integer)
- m_Id = value
- End Set
- End Property
- Private m_Id As Integer
- Public Property Description() As String
- Get
- Return m_Description
- End Get
- Set(value As String)
- m_Description = value
- End Set
- End Property
- Private m_Description As String
- Public Sub New(id As Integer, description As String)
- Me.Id = id
- Me.Description = description
- End Sub
-End Class
-Public Sub Bind()
- Dim items As New List(Of Item)()
- For i As Integer = 0 To 9
- items.Add(New Item(i, "Data" + i))
- Next
- Me.radDropDownList1.DataSource = items
- Me.radDropDownList1.DisplayMember = "Description"
- Me.radDropDownList1.ValueMember = "Id"
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
>caption Figure: 4 RadDropDownList bound at Run time
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/right-to-left-support.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/right-to-left-support.md
index fb5587165..8db1c0dc5 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/right-to-left-support.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/right-to-left-support.md
@@ -27,19 +27,10 @@ __RadDropDownList__ fully supports right-to-left (RTL) language locales. You can
#### Assigning RightToLeft
-{{source=..\SamplesCS\DropDownListControl\DropDownList\DropDownListRightToLeft.cs region=SetRightToLeft}}
-{{source=..\SamplesVB\DropDownListControl\DropDownList\DropDownListRightToLeft.vb region=SetRightToLeft}}
+
+
-````C#
-this.radDropDownList1.RightToLeft = RightToLeft.Yes;
-
-````
-````VB.NET
-Me.radDropDownList1.RightToLeft = RightToLeft.Yes
-
-````
-
-{{endregion}}
+
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/add-custom-fonts.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/add-custom-fonts.md
index 056f80f1e..95d637d38 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/add-custom-fonts.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/add-custom-fonts.md
@@ -14,20 +14,18 @@ Since R2 2019 SP1 (version 2019.2.618) __RadFontDropDownList__ supports adding c
#### Add Custom Font to RadFontDropDownList
-{{source=..\SamplesCS\Editors\FontDropDownList.cs region=AddCustomFont}}
-{{source=..\SamplesVB\Editors\FontDropDownList.vb region=AddCustomFont}}
-
+
+
-{{endregion}}
+
The font can be easily removed as well.
#### Remove Custom Font from RadFontDropDownList
-{{source=..\SamplesCS\Editors\FontDropDownList.cs region=RemoveCustomFont}}
-{{source=..\SamplesVB\Editors\FontDropDownList.vb region=RemoveCustomFont}}
-
+
+
-{{endregion}}
+
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/customizing-appearance/accessing-and-customizing-elements.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/customizing-appearance/accessing-and-customizing-elements.md
index 7366153fa..604c6a850 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/customizing-appearance/accessing-and-customizing-elements.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/customizing-appearance/accessing-and-customizing-elements.md
@@ -33,30 +33,9 @@ You can customize the nested elements at run time as well:
#### Customize elements
-{{source=..\SamplesCS\Editors\FontDropDownList.cs region=CustomizeElements}}
-{{source=..\SamplesVB\Editors\FontDropDownList.vb region=CustomizeElements}}
-
-````C#
-this.radFontDropDownList1.BackColor = Color.Yellow;
-this.radFontDropDownList1.PopupEditorElement.ArrowButtonElement.Fill.BackColor = Color.Aqua;
-this.radFontDropDownList1.PopupEditorElement.ArrowButtonElement.Fill.GradientStyle = GradientStyles.Solid;
-this.radFontDropDownList1.EditableAreaElement.ForeColor = Color.Red;
-this.radFontDropDownList1.EditableAreaElement.DrawBorder = true;
-this.radFontDropDownList1.EditableAreaElement.BorderColor = Color.Red;
-this.radFontDropDownList1.EditableAreaElement.BorderGradientStyle = GradientStyles.Solid;
-
-````
-````VB.NET
-Me.RadFontDropDownList1.BackColor = Color.Yellow
-Me.RadFontDropDownList1.PopupEditorElement.ArrowButtonElement.Fill.BackColor = Color.Aqua
-Me.RadFontDropDownList1.PopupEditorElement.ArrowButtonElement.Fill.GradientStyle = GradientStyles.Solid
-Me.RadFontDropDownList1.EditableAreaElement.ForeColor = Color.Red
-Me.RadFontDropDownList1.EditableAreaElement.DrawBorder = True
-Me.RadFontDropDownList1.EditableAreaElement.BorderColor = Color.Red
-Me.RadFontDropDownList1.EditableAreaElement.BorderGradientStyle = GradientStyles.Solid
-
-````
-
-{{endregion}}
+
+
+
+
In order to style the pop-up items it is suitable to use the [Formatting Items]({%slug winforms/editors/fontdropdownlist/accessing-and-customizing-elements/formatting-items%}) event.
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/customizing-appearance/formatting-items.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/customizing-appearance/formatting-items.md
index 7ec42a33b..f3672009e 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/customizing-appearance/formatting-items.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/customizing-appearance/formatting-items.md
@@ -18,59 +18,7 @@ You can access the hosted **RadListView** control by the RadFontDropDownList.**F
#### Formatting the cell elements
-{{source=..\SamplesCS\Editors\FontDropDownList.cs region=ItemsFormatting}}
-{{source=..\SamplesVB\Editors\FontDropDownList.vb region=ItemsFormatting}}
+
+
-````C#
-private void FontListView_CellFormatting(object sender, Telerik.WinControls.UI.ListViewCellFormattingEventArgs e)
-{
- DetailListViewDataCellElement cell = e.CellElement as DetailListViewDataCellElement;
- if (cell == null)
- {
- return;
- }
- if (e.CellElement.Data.Name == "Preview" && e.CellElement.Text == "Aharoni")
- {
- e.CellElement.BackColor = Color.Yellow;
- e.CellElement.ForeColor = Color.Red;
- e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
- }
- else if (cell.Row.Selected)
- {
- e.CellElement.BackColor = Color.Aqua;
- e.CellElement.ForeColor = Color.Black;
- e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
- }
- else
- {
- e.CellElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local);
- e.CellElement.ResetValue(LightVisualElement.ForeColorProperty, Telerik.WinControls.ValueResetFlags.Local);
- e.CellElement.ResetValue(LightVisualElement.GradientStyleProperty, Telerik.WinControls.ValueResetFlags.Local);
- }
-}
-
-````
-````VB.NET
-Private Sub FontListView_CellFormatting(sender As Object, e As UI.ListViewCellFormattingEventArgs)
- Dim cell As DetailListViewDataCellElement = TryCast(e.CellElement, DetailListViewDataCellElement)
- If cell Is Nothing Then
- Return
- End If
- If e.CellElement.Data.Name = "Preview" AndAlso e.CellElement.Text = "Aharoni" Then
- e.CellElement.BackColor = Color.Yellow
- e.CellElement.ForeColor = Color.Red
- e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid
- ElseIf cell.Row.Selected Then
- e.CellElement.BackColor = Color.Aqua
- e.CellElement.ForeColor = Color.Black
- e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid
- Else
- e.CellElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local)
- e.CellElement.ResetValue(LightVisualElement.ForeColorProperty, Telerik.WinControls.ValueResetFlags.Local)
- e.CellElement.ResetValue(LightVisualElement.GradientStyleProperty, Telerik.WinControls.ValueResetFlags.Local)
- End If
-End Sub
-
-````
-
-{{endregion}}
+
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/getting-started.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/getting-started.md
index c9ab68c47..d42cc77a4 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/getting-started.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/getting-started.md
@@ -46,53 +46,10 @@ The following tutorial demonstrates how to add a **RadFontDropDownList** and how
5. Subscribe to the **SelectedFontChanged** event and use the following code snippet:
-{{source=..\SamplesCS\Editors\FontDropDownList.cs region=ChangeFont}}
-{{source=..\SamplesVB\Editors\FontDropDownList.vb region=ChangeFont}}
-
-````C#
-private void radFontDropDownList1_SelectedFontChanged(object sender, EventArgs e)
-{
- FontFamily ff = new FontFamily(this.radFontDropDownList1.SelectedFont);
- if (ff.IsStyleAvailable(FontStyle.Regular))
- {
- Font font = new Font(ff.Name, 10, FontStyle.Regular);
- this.radLabel1.Font = font;
- }
- else
- {
- foreach (FontStyle style in Enum.GetValues(typeof(FontStyle)))
- {
- if (ff.IsStyleAvailable(style))
- {
- Font font = new Font(ff.Name, 10, style);
- this.radLabel1.Font = font;
- break;
- }
- }
- }
-}
-
-````
-````VB.NET
-Private Sub radFontDropDownList1_SelectedFontChanged(ByVal sender As Object, ByVal e As EventArgs)
- Dim ff As FontFamily = New FontFamily(Me.RadFontDropDownList1.SelectedFont)
- If ff.IsStyleAvailable(FontStyle.Regular) Then
- Dim font As Font = New Font(ff.Name, 10, FontStyle.Regular)
- Me.radLabel1.Font = font
- Else
- For Each style As FontStyle In [Enum].GetValues(GetType(FontStyle))
- If ff.IsStyleAvailable(style) Then
- Dim font As Font = New Font(ff.Name, 10, style)
- Me.radLabel1.Font = font
- Exit For
- End If
- Next
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+

diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/localization.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/localization.md
index b760aee4b..e20a42380 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/localization.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/localization.md
@@ -14,21 +14,7 @@ RadFontDropDownList has only two string that can be localized and these are the
#### Localizing RadFontDropDownList
-{{source=..\SamplesCS\Editors\FontDropDownList.cs region=Localize}}
-{{source=..\SamplesVB\Editors\FontDropDownList.vb region=Localize}}
-````C#
-var element = radFontDropDownList1.PopupEditorElement as RadFontPopupEditorElement;
-element.AllFontsItemText = "All Fonts";
-element.RecentlyUsedItemText = "Recently Used Fonts";
+
+
-````
-````VB.NET
-Dim element = TryCast(RadFontDropDownList1.PopupEditorElement, RadFontPopupEditorElement)
-element.AllFontsItemText = "All Fonts"
-element.RecentlyUsedItemText = "Recently Used Fonts"
-
-````
-
-
-
-{{endregion}}
+
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/update-recently-used-fonts.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/update-recently-used-fonts.md
index 2d77a0735..90b08fea9 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/update-recently-used-fonts.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/fontdropdownlist/update-recently-used-fonts.md
@@ -17,9 +17,8 @@ To update the fonts yu can use the __UpdateRecentlyUsedFonts__ method and pass t
#### Update the recently used fonts
-{{source=..\SamplesCS\Editors\FontDropDownList.cs region=UpdateRecentlyUsed}}
-{{source=..\SamplesVB\Editors\FontDropDownList.vb region=UpdateRecentlyUsed}}
-
+
+
-{{endregion}}
+
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/customizing-appearance/formatting-items.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/customizing-appearance/formatting-items.md
index 62f87f27c..67e035b15 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/customizing-appearance/formatting-items.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/customizing-appearance/formatting-items.md
@@ -20,143 +20,19 @@ Items appearance in __RadListControl__ can be customized by making use of the __
#### Formatting items
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=VisualItemFormatting}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=VisualItemFormatting}}
-
-````C#
-Font font = new Font("Consolas", 14, FontStyle.Bold);
-private void radListControl1_VisualItemFormatting(object sender, VisualItemFormattingEventArgs args)
-{
- if (args.VisualItem.Selected)
- {
- args.VisualItem.NumberOfColors = 1;
- args.VisualItem.BackColor = Color.LightGreen;
- args.VisualItem.ForeColor = Color.Red;
- args.VisualItem.BorderColor = Color.Blue;
- args.VisualItem.Font = font;
- }
- else
- {
- args.VisualItem.ResetValue(LightVisualElement.NumberOfColorsProperty, Telerik.WinControls.ValueResetFlags.Local);
- args.VisualItem.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local);
- args.VisualItem.ResetValue(LightVisualElement.ForeColorProperty, Telerik.WinControls.ValueResetFlags.Local);
- args.VisualItem.ResetValue(LightVisualElement.BorderColorProperty, Telerik.WinControls.ValueResetFlags.Local);
- args.VisualItem.ResetValue(LightVisualElement.FontProperty, Telerik.WinControls.ValueResetFlags.Local);
- }
-}
-
-````
-````VB.NET
-Private font As New Font("Consolas", 14, FontStyle.Bold)
-Private Sub radListControl1_VisualItemFormatting(sender As Object, args As VisualItemFormattingEventArgs)
- If args.VisualItem.Selected Then
- args.VisualItem.NumberOfColors = 1
- args.VisualItem.BackColor = Color.LightGreen
- args.VisualItem.ForeColor = Color.Red
- args.VisualItem.BorderColor = Color.Blue
- args.VisualItem.Font = font
- Else
- args.VisualItem.ResetValue(LightVisualElement.NumberOfColorsProperty, Telerik.WinControls.ValueResetFlags.Local)
- args.VisualItem.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local)
- args.VisualItem.ResetValue(LightVisualElement.ForeColorProperty, Telerik.WinControls.ValueResetFlags.Local)
- args.VisualItem.ResetValue(LightVisualElement.BorderColorProperty, Telerik.WinControls.ValueResetFlags.Local)
- args.VisualItem.ResetValue(LightVisualElement.FontProperty, Telerik.WinControls.ValueResetFlags.Local)
- End If
-End Sub
-'#End Region
-Class
-gion customDataItem
-ic Class CustomDataItem
-rits RadListDataItem
-Public Shared ReadOnly AvailableProperty As RadProperty = RadProperty.Register("Available", GetType(Boolean), GetType(CustomDataItem), New RadElementPropertyMetadata(False))
-Public Property Available() As Boolean
- Get
- Return CBool(Me.GetValue(CustomDataItem.AvailableProperty))
- End Get
- Set(ByVal value As Boolean)
- Me.SetValue(CustomDataItem.AvailableProperty, value)
- End Set
-End Property
-Class
-
-````
-
-{{endregion}}
+
+
+
+
## Alternating Item Color
__RadListControl__ supports alternating item color which can be easily enabled by just setting a couple of properties:
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=alternating}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=alternating}}
-
-````C#
-radListControl1.EnableAlternatingItemColor = true;
-radListControl1.ListElement.AlternatingItemColor = Color.Red;
-
-````
-````VB.NET
-radListControl1.EnableAlternatingItemColor = True
-radListControl1.ListElement.AlternatingItemColor = Color.Red
-'#End Region
-'#Region "AddItemsProgrammatically"
-Dim descriptionItem As New DescriptionTextListDataItem()
-descriptionItem.Text = "Chicken wings"
-descriptionItem.Image = My.Resources.chicken_wings
-descriptionItem.DescriptionText = "some description"
-Me.radListControl1.Items.Add(descriptionItem)
-Dim dataItem As New RadListDataItem()
-dataItem.Text = "Chicken toast"
-dataItem.Image = My.Resources.chicken_toast
-Me.radListControl1.Items.Add(dataItem)
-'#End Region
-'#Region "expression"
-Me.radListControl1.FilterExpression = "Country LIKE 'Argentina'"
-'#End Region
-End Sub
-'#Region "Binding"
-Public Class Item
-Public Property Id() As Integer
- Get
- Return m_Id
- End Get
- Set(value As Integer)
- m_Id = value
- End Set
-End Property
-Private m_Id As Integer
-Public Property Description() As String
- Get
- Return m_Description
- End Get
- Set(value As String)
- m_Description = value
- End Set
-End Property
-Private m_Description As String
-Public Sub New(id As Integer, description As String)
- Me.Id = id
- Me.Description = description
-End Sub
-End Class
-Public Sub Bind()
-Dim items As New List(Of Item)()
-For i As Integer = 0 To 9
- items.Add(New Item(i, "Data" + i))
-Next
-radListControl1.DataSource = items
-radListControl1.DisplayMember = "Description"
-radListControl1.ValueMember = "Id"
-End Sub
-'#End Region
-'#region creatingVisualListItem
-Private Sub radListControl1_CreatingVisualListItem(ByVal sender As Object, ByVal args As CreatingVisualListItemEventArgs)
-args.VisualItem = New CustomVisualItem()
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
>caption Figure 2: AlternatingItemColor
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/customizing-items-(visual-appearance).md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/customizing-items-(visual-appearance).md
index a051e9806..d329a1715 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/customizing-items-(visual-appearance).md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/customizing-items-(visual-appearance).md
@@ -25,131 +25,38 @@ The aim of this article is to demonstrate how you can achieve to look shown belo
#### Handling the ItemDataBound event
-{{source=..\SamplesCS\DropDownListControl\ListControl\CustomizingItems.cs region=itemDataBound}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\CustomizingItems.vb region=itemDataBound}}
-
-````C#
-void radListControl1_ItemDataBound(object sender, ListItemDataBoundEventArgs args)
-{
- DataRowView view = (DataRowView)args.NewItem.DataBoundItem;
- args.NewItem.Text = "" + view["TitleOfCourtesy"] + "" +
- " " + view["FirstName"] +
- " " + view["LastName"] +
- " " + view["Title"];
- NwindDataSet.EmployeesRow row = view.Row as NwindDataSet.EmployeesRow;
- args.NewItem.Image = GetImageFromData(row.Photo);
-}
-
-````
-````VB.NET
-Private Sub radListControl1_ItemDataBound(ByVal sender As Object, ByVal args As Telerik.WinControls.UI.ListItemDataBoundEventArgs)
- Dim view As DataRowView = CType(args.NewItem.DataBoundItem, DataRowView)
- args.NewItem.Text = "" & view("TitleOfCourtesy") & "" & " " & view("FirstName") & " " & view("LastName") & " " & view("Title")
- Dim row As NwindDataSet.EmployeesRow = TryCast(view.Row, NwindDataSet.EmployeesRow)
- args.NewItem.Image = GetImageFromData(row.Photo)
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
#### Image helper method
-{{source=..\SamplesCS\DropDownListControl\ListControl\CustomizingItems.cs region=getImageData}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\CustomizingItems.vb region=getImageData}}
-
-````C#
-private bool HasOleContainerHeader(byte[] imageByteArray)
-{
- const byte OleByte0 = 21;
- const byte OleByte1 = 28;
- return (imageByteArray[0] == OleByte0) && (imageByteArray[1] == OleByte1);
-}
-private Image GetImageFromData(byte[] imageData)
-{
- const int OleHeaderLength = 78;
- MemoryStream memoryStream = new MemoryStream();
- if (HasOleContainerHeader(imageData))
- {
- memoryStream.Write(imageData, OleHeaderLength, imageData.Length - OleHeaderLength);
- }
- else
- {
- memoryStream.Write(imageData, 0, imageData.Length);
- }
- Bitmap bitmap = new Bitmap(memoryStream);
- return bitmap.GetThumbnailImage(55, 65, null, new IntPtr());
-}
-
-````
-````VB.NET
-Private Function HasOleContainerHeader(ByVal imageByteArray As Byte()) As Boolean
- Const OleByte0 As Byte = 21
- Const OleByte1 As Byte = 28
- Return (imageByteArray(0) = OleByte0) AndAlso (imageByteArray(1) = OleByte1)
-End Function
-Private Function GetImageFromData(ByVal imageData As Byte()) As Image
- Const OleHeaderLength As Integer = 78
- Dim memoryStream As MemoryStream = New MemoryStream()
- If HasOleContainerHeader(imageData) Then
- memoryStream.Write(imageData, OleHeaderLength, imageData.Length - OleHeaderLength)
- Else
- memoryStream.Write(imageData, 0, imageData.Length)
- End If
- Dim bitmap As Bitmap = New Bitmap(memoryStream)
- Return bitmap.GetThumbnailImage(55, 65, Nothing, New IntPtr())
-End Function
-
-````
-
-{{endregion}}
+
+
+
+
2\. Since the *< br >* tag will split the __Text__ value in different lines, it is essential to set the __AutoSizeItems__ of RadListControl to *true*:
#### Setting AutoSizeItems
-{{source=..\SamplesCS\DropDownListControl\ListControl\CustomizingItems.cs region=autoSizeItems}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\CustomizingItems.vb region=autoSizeItems}}
+
+
-````C#
-this.radListControl1.AutoSizeItems = true;
-````
-````VB.NET
-Me.radListControl1.AutoSizeItems = True
-````
-
-{{endregion}}
3\. Should you want to have apply some padding to the visual items, you should do it on CreatingVisualListItem event:
#### Applying Padding to the visual list items
-{{source=..\SamplesCS\DropDownListControl\ListControl\CustomizingItems.cs region=creatingVisualListItem}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\CustomizingItems.vb region=creatingVisualListItem}}
-
-````C#
-void radListControl1_CreatingVisualListItem(object sender, CreatingVisualListItemEventArgs args)
-{
- RadListVisualItem visualItem = new RadListVisualItem();
- visualItem.Padding = new Padding(5, 5, 0, 5);
- args.VisualItem = visualItem;
-}
-
-````
-````VB.NET
-Private Sub radListControl1_CreatingVisualListItem(ByVal sender As Object, ByVal args As Telerik.WinControls.UI.CreatingVisualListItemEventArgs)
- Dim visualItem As RadListVisualItem = New RadListVisualItem()
- visualItem.Padding = New Padding(5, 5, 0, 5)
- args.VisualItem = visualItem
-End Sub
+
+
-````
-{{endregion}}
# See Also
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/data-representation.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/data-representation.md
index daef005ce..0e4f34076 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/data-representation.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/data-representation.md
@@ -19,67 +19,21 @@ __RadListDataItem__ initially has the most basic visual properties required whic
#### RadListDataItem
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=customDataItem}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=customDataItem}}
-
-````C#
-public class CustomDataItem : RadListDataItem
-{
- public static readonly RadProperty AvailableProperty = RadProperty.Register("Available", typeof(bool), typeof(CustomDataItem), new RadElementPropertyMetadata(false));
- public bool Available
- {
- get
- {
- return (bool)this.GetValue(CustomDataItem.AvailableProperty);
- }
- set
- {
- this.SetValue(CustomDataItem.AvailableProperty, value);
- }
- }
-}
-
-````
-````VB.NET
-Public Class CustomDataItem
-Inherits RadListDataItem
- Public Shared ReadOnly AvailableProperty As RadProperty = RadProperty.Register("Available", GetType(Boolean), GetType(CustomDataItem), New RadElementPropertyMetadata(False))
- Public Property Available() As Boolean
- Get
- Return CBool(Me.GetValue(CustomDataItem.AvailableProperty))
- End Get
- Set(ByVal value As Boolean)
- Me.SetValue(CustomDataItem.AvailableProperty, value)
- End Set
- End Property
-End Class
-
-````
-
-{{endregion}}
+
+
+
+
+
Once we have the custom data item with the additional information, we can convince __RadListControl__ to use our class when creating logical items by using the __ItemDataBinding__ event. Consider the following code snippet:
#### using custom data items
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=itemDataBinding}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=itemDataBinding}}
-
-````C#
-void radListControl1_ItemDataBinding(object sender, ListItemDataBindingEventArgs args)
-{
- args.NewItem = new CustomDataItem();
-}
+
+
-````
-````VB.NET
-Private Sub radListControl1_ItemDataBinding(ByVal sender As Object, ByVal args As ListItemDataBindingEventArgs)
- args.NewItem = New CustomDataItem()
-End Sub
-````
-{{endregion}}
With this in place we have modified __RadListControl__ to use our type of logical objects which will provide the ability to display custom visual elements, a checkbox for example, in the visual representation of the data items. The next topic describes how to extend the visual items and how to provide the visual synchronization of the additional properties defined for the data item.
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/drag-and-drop/drag-and-drop-in-bound-mode.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/drag-and-drop/drag-and-drop-in-bound-mode.md
index 8aee27a82..64df269e2 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/drag-and-drop/drag-and-drop-in-bound-mode.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/drag-and-drop/drag-and-drop-in-bound-mode.md
@@ -26,263 +26,49 @@ The drag and drop functionality is achieved with the help of four events: __Mous
#### MouseDown and MouseMove
-{{source=..\SamplesCS\DropDownListControl\ListControl\DragAndDrop.cs region=MouseDownMove}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\DragAndDrop.vb region=MouseDownMove}}
-
-````C#
-
-private Point mouseDownPosition;
-
-void radListControl1_MouseDown(object sender, MouseEventArgs e)
-{
- this.mouseDownPosition = e.Location;
-}
-
-void radListControl1_MouseMove(object sender, MouseEventArgs e)
-{
- if (e.Button != MouseButtons.Left)
- {
- return;
- }
-
- RadListControl listControl = sender as RadListControl;
- RadListVisualItem draggedItem = listControl.ElementTree.GetElementAtPoint(this.mouseDownPosition) as RadListVisualItem;
- if (draggedItem != null&& IsRealDrag(mouseDownPosition, e.Location))
- {
- (sender as RadListControl).DoDragDrop(draggedItem.Data, DragDropEffects.Move);
- }
-}
-private static bool IsRealDrag(Point mousePosition, Point initialMousePosition)
-{
- return (Math.Abs(mousePosition.X - initialMousePosition.X) >= SystemInformation.DragSize.Width) ||
- (Math.Abs(mousePosition.Y - initialMousePosition.Y) >= SystemInformation.DragSize.Height);
-}
-
-````
-````VB.NET
-Private mouseDownPosition As Point
-Private Sub radListControl1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
- Me.mouseDownPosition = e.Location
-End Sub
-Private Sub radListControl1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
- If e.Button <> MouseButtons.Left Then
- Return
- End If
- Dim listControl As RadListControl = TryCast(sender, RadListControl)
- Dim draggedItem As RadListVisualItem = TryCast(listControl.ElementTree.GetElementAtPoint(Me.mouseDownPosition), RadListVisualItem)
- If draggedItem IsNot Nothing AndAlso IsRealDrag(mouseDownPosition, e.Location) Then
- TryCast(sender, RadListControl).DoDragDrop(draggedItem.Data, DragDropEffects.Move)
- End If
-End Sub
-Private Shared Function IsRealDrag(ByVal mousePosition As Point, ByVal initialMousePosition As Point) As Boolean
- Return (Math.Abs(mousePosition.X - initialMousePosition.X) >= SystemInformation.DragSize.Width) OrElse (Math.Abs(mousePosition.Y - initialMousePosition.Y) >= SystemInformation.DragSize.Height)
-End Function
-
-````
-
-{{endregion}}
+
+
+
+
+
2\. Handling the __DragEnter__ event: This event will fire when the mouse is hovering over a control that allows dropping. Here you can use it to disable the drop operation within the same control.
#### The DragEnter event handler
-{{source=..\SamplesCS\DropDownListControl\ListControl\DragAndDrop.cs region=DragEnter}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\DragAndDrop.vb region=DragEnter}}
-
-````C#
-void radListControl1_DragEnter(object sender, DragEventArgs e)
-{
- RadListControl listControl = sender as RadListControl;
- RadListDataItem draggedItem = e.Data.GetData(typeof(RadListDataItem)) as RadListDataItem;
-
- if (draggedItem.OwnerControl == listControl)
- {
- e.Effect = DragDropEffects.None;
- }
- else
- {
- e.Effect = DragDropEffects.Move;
- }
-}
-
-````
-````VB.NET
-Private Sub radListControl1_DragEnter(ByVal sender As Object, ByVal e As DragEventArgs)
- Dim listControl As RadListControl = TryCast(sender, RadListControl)
- Dim draggedItem As RadListDataItem = TryCast(e.Data.GetData(GetType(RadListDataItem)), RadListDataItem)
- If draggedItem.OwnerControl Is listControl Then
- e.Effect = DragDropEffects.None
- Else
- e.Effect = DragDropEffects.Move
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
+
3\. Handling the __DragDrop__ event: This is the most important event. In it you have access to both, the dragged element and the control where the item is dropped. This allows you to handle the drop operation appropriately according to your specific requirements. In this case, both controls are bound, and this allows you to just add/remove items from/to their data source (the changes will be immediately reflected by the controls).
#### The DragDrop event handler
-{{source=..\SamplesCS\DropDownListControl\ListControl\DragAndDrop.cs region=DragDrop}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\DragAndDrop.vb region=DragDrop}}
-
-````C#
-void radListControl2_DragDrop(object sender, DragEventArgs e)
-{
- RadListControl listControl = sender as RadListControl;
- RadListDataItem draggedItem = e.Data.GetData(typeof(RadListDataItem)) as RadListDataItem;
-
- MyCustomObject dragedData = draggedItem.DataBoundItem as MyCustomObject;
-
- if (myList1.Contains(dragedData))
- {
- myList1.Remove(dragedData);
- myList.Add(dragedData);
- }
- else
- {
- myList.Remove(dragedData);
- myList1.Add(dragedData);
- }
-}
-
-````
-````VB.NET
-Private Sub radListControl2_DragDrop(ByVal sender As Object, ByVal e As DragEventArgs)
- Dim listControl As RadListControl = TryCast(sender, RadListControl)
- Dim draggedItem As RadListDataItem = TryCast(e.Data.GetData(GetType(RadListDataItem)), RadListDataItem)
- Dim dragedData As CustomObject = TryCast(draggedItem.DataBoundItem, CustomObject)
- If myList1.Contains(dragedData) Then
- myList1.Remove(dragedData)
- myList.Add(dragedData)
- Else
- myList.Remove(dragedData)
- myList1.Add(dragedData)
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
+
Additionally, you should enable the __AllowDrop__ property for both controls. With this example you can move from the first __RadListControl__ to the second and vice versa. Along with this, the following snippet shows how you can bind the controls and subscribe to the events. The same events are used for both controls.
#### Controls initialization
-{{source=..\SamplesCS\DropDownListControl\ListControl\DragAndDrop.cs region=Initialize}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\DragAndDrop.vb region=Initialize}}
-
-````C#
-
-BindingList myList;
-BindingList myList1;
-
-public DragAndDrop()
-{
- InitializeComponent();
-
- myList = new BindingList();
- myList1 = new BindingList();
-
- myList.Add(new MyCustomObject(1, "Outdoor"));
- myList.Add(new MyCustomObject(8, "Hardware"));
- myList.Add(new MyCustomObject(3, "Tools"));
- myList1.Add(new MyCustomObject(6, "Books"));
- myList1.Add(new MyCustomObject(2, "Appliances"));
-
- radListControl1.DataSource = myList;
- radListControl1.DisplayMember = "Category";
- radListControl1.ValueMember = "ID";
- radListControl1.AllowDrop = true;
-
- radListControl2.DataSource = myList1;
- radListControl2.DisplayMember = "Category";
- radListControl2.ValueMember = "ID";
- radListControl2.AllowDrop = true;
-
- radListControl1.MouseDown += radListControl1_MouseDown;
- radListControl1.MouseMove += radListControl1_MouseMove;
- radListControl1.DragEnter += radListControl1_DragEnter;
- radListControl1.DragDrop += radListControl2_DragDrop;
-
- radListControl2.MouseDown += radListControl1_MouseDown;
- radListControl2.MouseMove += radListControl1_MouseMove;
- radListControl2.DragEnter += radListControl1_DragEnter;
- radListControl2.DragDrop += radListControl2_DragDrop;
-}
-
-````
-````VB.NET
-Private myList As BindingList(Of CustomObject)
-Private myList1 As BindingList(Of CustomObject)
-Public Sub New()
- InitializeComponent()
- myList = New BindingList(Of CustomObject)()
- myList1 = New BindingList(Of CustomObject)()
- myList.Add(New CustomObject(1, "Outdoor"))
- myList.Add(New CustomObject(8, "Hardware"))
- myList.Add(New CustomObject(3, "Tools"))
- myList1.Add(New CustomObject(6, "Books"))
- myList1.Add(New CustomObject(2, "Appliances"))
- radListControl1.DataSource = myList
- radListControl1.DisplayMember = "Category"
- radListControl1.ValueMember = "ID"
- radListControl1.AllowDrop = True
- radListControl2.DataSource = myList1
- radListControl2.DisplayMember = "Category"
- radListControl2.ValueMember = "ID"
- radListControl2.AllowDrop = True
- AddHandler radListControl1.MouseDown, AddressOf radListControl1_MouseDown
- AddHandler radListControl1.MouseMove, AddressOf radListControl1_MouseMove
- AddHandler radListControl1.DragEnter, AddressOf radListControl1_DragEnter
- AddHandler radListControl1.DragDrop, AddressOf radListControl2_DragDrop
- AddHandler radListControl2.MouseDown, AddressOf radListControl1_MouseDown
- AddHandler radListControl2.MouseMove, AddressOf radListControl1_MouseMove
- AddHandler radListControl2.DragEnter, AddressOf radListControl1_DragEnter
- AddHandler radListControl2.DragDrop, AddressOf radListControl2_DragDrop
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
To complete the example you can use the following sample class.
#### Sample business object for the example
-{{source=..\SamplesCS\DropDownListControl\ListControl\DragAndDrop.cs region=CustomObject}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\DragAndDrop.vb region=CustomObject}}
-
-````C#
-
-public class MyCustomObject
-{
- public int ID { get; set; }
-
- public string Category { get; set; }
- public MyCustomObject(int iD, string category)
- {
- this.ID = iD;
- this.Category = category;
- }
-}
-
-````
-````VB.NET
-Public Class CustomObject
- Public Property ID() As Integer
- Public Property Category() As String
- Public Sub New(ByVal iD As Integer, ByVal category As String)
- Me.ID = iD
- Me.Category = category
- End Sub
-End Class
-
-````
-
-{{endregion}}
+
+
+
+
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/drag-and-drop/listcontroldragdropservice.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/drag-and-drop/listcontroldragdropservice.md
index 0bfe44c85..3cfd67908 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/drag-and-drop/listcontroldragdropservice.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/drag-and-drop/listcontroldragdropservice.md
@@ -32,225 +32,25 @@ The following steps demonstrates how to populate two **RadListControls** with it
1\. Consider that you have two **RadListControls** which are bound to a **BindingList** of custom *Item* objects.
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControlBoundDragDrop.cs region=BoundListControl}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControlBoundDragDrop.vb region=BoundListControl}}
+
+
-````C#
-
-public ListControlBoundDragDrop()
-{
- InitializeComponent();
- BindingList items = new BindingList();
- BindingList items2 = new BindingList();
- for (int i = 0; i < 20; i++)
- {
- items.Add(new Item(i, "Item.1." + i));
- items2.Add(new Item(i, "Item.2." + i));
- }
-
- this.radListControl1.DataSource = items;
- this.radListControl1.DisplayMember = "Name";
- this.radListControl1.ValueMember = "Id";
-
- this.radListControl2.DataSource = items2;
- this.radListControl2.DisplayMember = "Name";
- this.radListControl2.ValueMember = "Id";
-}
-
-public class Item
-{
- public int Id { get; set; }
-
- public string Name { get; set; }
-
- public Item(int id, string name)
- {
- this.Id = id;
- this.Name = name;
- }
-}
-````
-````VB.NET
-Public Sub New()
- InitializeComponent()
- Dim items As New BindingList(Of Item)()
- Dim items2 As New BindingList(Of Item)()
- For i As Integer = 0 To 19
- items.Add(New Item(i, "Item.1." & i))
- items2.Add(New Item(i, "Item.2." & i))
- Next
- Me.RadListControl1.DataSource = items
- Me.RadListControl1.DisplayMember = "Name"
- Me.RadListControl1.ValueMember = "Id"
- Me.RadListControl2.DataSource = items2
- Me.RadListControl2.DisplayMember = "Name"
- Me.RadListControl2.ValueMember = "Id"
-End Sub
-Public Class Item
- Public Property Id() As Integer
- Get
- Return m_Id
- End Get
- Set(value As Integer)
- m_Id = value
- End Set
- End Property
- Private m_Id As Integer
- Public Property Name() As String
- Get
- Return m_Name
- End Get
- Set(value As String)
- m_Name = value
- End Set
- End Property
- Private m_Name As String
- Public Sub New(id As Integer, name As String)
- Me.Id = id
- Me.Name = name
- End Sub
-End Class
-
-````
-
-{{endregion}}
2\. Set the **AllowDragDrop** property for both of the **RadListControls** to *true*.
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControlBoundDragDrop.cs region=EnableDragDrop}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControlBoundDragDrop.vb region=EnableDragDrop}}
-
-````C#
-
-this.radListControl1.AllowDragDrop = true;
-this.radListControl2.AllowDragDrop = true;
+
+
-````
-````VB.NET
-Me.RadListControl1.AllowDragDrop = True
-Me.RadListControl2.AllowDragDrop = True
-````
-
-{{endregion}}
3\. Handle the service's events in order to achieve the desired drag and drop behavior. In the **PreviewDragStart** event of **ListControlDragDropService** you can store the dragged data item. Set the PreviewDragStartEventArgs.**CanStart** property to *true* in order to indicate the drag operation is allowed. The **PreviewDragOver** event allows you to control on what targets the item being dragged can be dropped on. The **PreviewDragDrop** event allows you to get a handle on all the aspects of the drag and drop operation, the source (drag) **RadListControl**, the destination (target) control, as well as the item being dragged. This is where we will initiate the actual physical move of the item(s) from **RadListControl** to the target control.
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControlBoundDragDrop.cs region=ListControlDragDrop}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControlBoundDragDrop.vb region=ListControlDragDrop}}
-
-````C#
-
-private void ListControlBoundDragDrop_Shown(object sender, EventArgs e)
-{
- this.radListControl1.ListElement.DragDropService.PreviewDragStart += DragDropService_PreviewDragStart;
- this.radListControl1.ListElement.DragDropService.PreviewDragOver += DragDropService_PreviewDragOver;
- this.radListControl1.ListElement.DragDropService.PreviewDragDrop += DragDropService_PreviewDragDrop;
-}
-
-RadListDataItem draggedItem = null;
-
-private void DragDropService_PreviewDragStart(object sender, Telerik.WinControls.PreviewDragStartEventArgs e)
-{
- RadListVisualItem draggedVisualitem = e.DragInstance as RadListVisualItem;
- if (draggedVisualitem != null)
- {
- draggedItem = draggedVisualitem.Data;
- e.CanStart = true;
- }
- else
- {
- e.CanStart = false;
- }
-}
-
-private void DragDropService_PreviewDragOver(object sender, Telerik.WinControls.RadDragOverEventArgs e)
-{
- RadListVisualItem targetVisualItem = e.HitTarget as RadListVisualItem;
- RadListElement targetListElement = e.HitTarget as RadListElement;
- if (targetVisualItem != null || targetListElement != null)
- {
- e.CanDrop = true;
- }
- else
- {
- e.CanDrop = false;
- }
-}
-
-private void DragDropService_PreviewDragDrop(object sender, Telerik.WinControls.RadDropEventArgs e)
-{
- RadListVisualItem targetVisualItem = e.HitTarget as RadListVisualItem;
- RadListElement targetListElement = e.HitTarget as RadListElement;
- if (targetVisualItem != null)
- {
- targetListElement = targetVisualItem.Data.Owner as RadListElement;
- }
- if (targetListElement == null)
- {
- return;
- }
- e.Handled = true;
- BindingList targetSourceItems = targetListElement.DataSource as BindingList;
- BindingList draggtedSourceItems = this.draggedItem.Owner.DataSource as BindingList;
- int draggedItemIndex = draggtedSourceItems.IndexOf(this.draggedItem.DataBoundItem as Item);
- int targetItemIndex = targetVisualItem == null ? targetSourceItems.Count-1 : targetSourceItems.IndexOf(targetVisualItem.Data.DataBoundItem as Item);
-
- Item item = this.draggedItem.DataBoundItem as Item;
- targetSourceItems.RemoveAt(draggedItemIndex);
- targetSourceItems.Insert(targetItemIndex, new Item(item.Id, item.Name));
-}
-
-````
-````VB.NET
-Private Sub ListControlBoundDragDrop_Shown(sender As Object, e As EventArgs) Handles Me.Shown
- AddHandler Me.RadListControl1.ListElement.DragDropService.PreviewDragStart, AddressOf DragDropService_PreviewDragStart
- AddHandler Me.RadListControl1.ListElement.DragDropService.PreviewDragOver, AddressOf DragDropService_PreviewDragOver
- AddHandler Me.RadListControl1.ListElement.DragDropService.PreviewDragDrop, AddressOf DragDropService_PreviewDragDrop
-End Sub
-Private draggedItem As RadListDataItem = Nothing
-Private Sub DragDropService_PreviewDragStart(sender As Object, e As Telerik.WinControls.PreviewDragStartEventArgs)
- Dim draggedVisualitem As RadListVisualItem = TryCast(e.DragInstance, RadListVisualItem)
- If draggedVisualitem IsNot Nothing Then
- draggedItem = draggedVisualitem.Data
- e.CanStart = True
- Else
- e.CanStart = False
- End If
-End Sub
-Private Sub DragDropService_PreviewDragOver(sender As Object, e As Telerik.WinControls.RadDragOverEventArgs)
- Dim targetVisualItem As RadListVisualItem = TryCast(e.HitTarget, RadListVisualItem)
- Dim targetListElement As RadListElement = TryCast(e.HitTarget, RadListElement)
- If targetVisualItem IsNot Nothing OrElse targetListElement IsNot Nothing Then
- e.CanDrop = True
- Else
- e.CanDrop = False
- End If
-End Sub
-Private Sub DragDropService_PreviewDragDrop(sender As Object, e As Telerik.WinControls.RadDropEventArgs)
- Dim targetVisualItem As RadListVisualItem = TryCast(e.HitTarget, RadListVisualItem)
- Dim targetListElement As RadListElement = TryCast(e.HitTarget, RadListElement)
- If targetVisualItem IsNot Nothing Then
- targetListElement = TryCast(targetVisualItem.Data.Owner, RadListElement)
- End If
- If targetListElement Is Nothing Then
- Return
- End If
- e.Handled = True
- Dim targetSourceItems As BindingList(Of Item) = TryCast(targetListElement.DataSource, BindingList(Of Item))
- Dim draggtedSourceItems As BindingList(Of Item) = TryCast(Me.draggedItem.Owner.DataSource, BindingList(Of Item))
- Dim draggedItemIndex As Integer = draggtedSourceItems.IndexOf(TryCast(Me.draggedItem.DataBoundItem, Item))
- Dim targetItemIndex As Integer = If(targetVisualItem Is Nothing, targetSourceItems.Count - 1, targetSourceItems.IndexOf(TryCast(targetVisualItem.Data.DataBoundItem, Item)))
- Dim item As Item = TryCast(Me.draggedItem.DataBoundItem, Item)
- targetSourceItems.RemoveAt(draggedItemIndex)
- targetSourceItems.Insert(targetItemIndex, New Item(item.Id, item.Name))
-End Sub
+
+
-````
-{{endregion}}
>caption Figure 2: Drag and Drop in Bound Mode
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features.md
index 6ca80d178..d1d6de6a4 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features.md
@@ -21,19 +21,11 @@ Sorting in RadListControl is controlled via the __SortStyle__ property. It suppo
#### Sorting
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=sorting}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=sorting}}
+
+
-````C#
-radListControl1.SortStyle = Telerik.WinControls.Enumerations.SortStyle.Ascending;
-````
-````VB.NET
-radListControl1.SortStyle = Telerik.WinControls.Enumerations.SortStyle.Ascending
-````
-
-{{endregion}}
Changing the sort style may cause the SelectedIndexChanged event to fire if the position of the previously selected item has changed after the sort operation.
@@ -44,41 +36,19 @@ RadListControl can filter which items are currently visible by using the __Filte
#### Filtering method body
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=filteringMethod}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=filteringMethod}}
-
-````C#
-private bool FilterMethod(RadListDataItem itemToFilter)
-{
- return itemToFilter.Text.EndsWith("SomeString");
-}
+
+
-````
-````VB.NET
-Private Function FilterMethod(ByVal itemToFilter As RadListDataItem) As Boolean
- Return itemToFilter.Text.EndsWith("SomeString")
-End Function
-````
-
-{{endregion}}
#### Setting the Filter property
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=filtering}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=filtering}}
-
-````C#
-radListControl1.Filter = FilterMethod;
+
+
-````
-````VB.NET
-radListControl1.Filter = AddressOf FilterMethod
-````
-{{endregion}}
Setting the Filter property will start a filtering operation which will call the FilterMethod for every item in RadListControl to determine if the item should be visible. After filtering RadListControl will contain the same number of items as before or less. Setting the Filter property to null resets any filtering and all items will be visible. Filtering may change the SelectedIndex property depending on whether the previously selected item is still visible.
@@ -89,37 +59,21 @@ RadListControl can search for an item with the FindString() and FindStringExact(
#### Searching
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=searching}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=searching}}
+
+
-````C#
-int index = radListControl1.FindString("someitem");
-````
-````VB.NET
-Dim index As Integer = radListControl1.FindString("someitem")
-````
-
-{{endregion}}
This method call will return the index of the first item with "someitem" as its text or -1 if no item has this been found. The second overload is called like this:
#### Searching
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=index}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=index}}
-
-````C#
-int index = radListControl1.FindString("someitem", 5);
+
+
-````
-````VB.NET
-Dim index As Integer = radListControl1.FindString("someitem", 5)
-````
-{{endregion}}
The second argument specifies the index after which the search will start. This means that in this case, the search will start at index 6. An important fact is that FindString() uses a wrapping linear search algorithm. If the item is not found when the end of the items collection is reached, it wraps and continues the search from the beginning until the start index is reached. Users can also search for an item with the keyboard. Setting the KeyboardSearchEnabled property to true will cause RadListControl to process keystrokes, build a string by appending each keystroke and then use the built string to find an item. Every keystroke initiates a new search starting at the last found item. This feature is also known as incremental search. The KeyboardSearchResetInterval property can be set in order to define how long the user must wait after pressing a key in order for the search to start from the beginning and for the built string to be destroyed.
@@ -146,76 +100,10 @@ RadListControl provides three scrolling modes that can be used depending on user
__RadListControl__ supports alternating item color which can be easily enabled by just setting a couple of properties:
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=alternating}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=alternating}}
-
-````C#
-radListControl1.EnableAlternatingItemColor = true;
-radListControl1.ListElement.AlternatingItemColor = Color.Red;
-
-````
-````VB.NET
-radListControl1.EnableAlternatingItemColor = True
-radListControl1.ListElement.AlternatingItemColor = Color.Red
-'#End Region
-'#Region "AddItemsProgrammatically"
-Dim descriptionItem As New DescriptionTextListDataItem()
-descriptionItem.Text = "Chicken wings"
-descriptionItem.Image = My.Resources.chicken_wings
-descriptionItem.DescriptionText = "some description"
-Me.radListControl1.Items.Add(descriptionItem)
-Dim dataItem As New RadListDataItem()
-dataItem.Text = "Chicken toast"
-dataItem.Image = My.Resources.chicken_toast
-Me.radListControl1.Items.Add(dataItem)
-'#End Region
-'#Region "expression"
-Me.radListControl1.FilterExpression = "Country LIKE 'Argentina'"
-'#End Region
-End Sub
-'#Region "Binding"
-Public Class Item
-Public Property Id() As Integer
- Get
- Return m_Id
- End Get
- Set(value As Integer)
- m_Id = value
- End Set
-End Property
-Private m_Id As Integer
-Public Property Description() As String
- Get
- Return m_Description
- End Get
- Set(value As String)
- m_Description = value
- End Set
-End Property
-Private m_Description As String
-Public Sub New(id As Integer, description As String)
- Me.Id = id
- Me.Description = description
-End Sub
-End Class
-Public Sub Bind()
-Dim items As New List(Of Item)()
-For i As Integer = 0 To 9
- items.Add(New Item(i, "Data" + i))
-Next
-radListControl1.DataSource = items
-radListControl1.DisplayMember = "Description"
-radListControl1.ValueMember = "Id"
-End Sub
-'#End Region
-'#region creatingVisualListItem
-Private Sub radListControl1_CreatingVisualListItem(ByVal sender As Object, ByVal args As CreatingVisualListItemEventArgs)
-args.VisualItem = New CustomVisualItem()
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/filtering.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/filtering.md
index 120bfeb9d..4a541cb3a 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/filtering.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/filtering.md
@@ -18,41 +18,19 @@ The __Filter__ property accepts a predicate method that can be used for arbitrar
#### Filtering method body
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=filteringMethod}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=filteringMethod}}
+
+
-````C#
-private bool FilterMethod(RadListDataItem itemToFilter)
-{
- return itemToFilter.Text.EndsWith("SomeString");
-}
-````
-````VB.NET
-Private Function FilterMethod(ByVal itemToFilter As RadListDataItem) As Boolean
- Return itemToFilter.Text.EndsWith("SomeString")
-End Function
-
-````
-
-{{endregion}}
#### Setting the Filter property
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=filtering}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=filtering}}
-
-````C#
-radListControl1.Filter = FilterMethod;
+
+
-````
-````VB.NET
-radListControl1.Filter = AddressOf FilterMethod
-````
-{{endregion}}
Setting the __Filter__ property will start a filtering operation which will call the __FilterMethod__ for every item in __RadListControl__ to determine if the item should be visible or not. After filtering, __RadListControl__ will contain the same number of items as before or less. Setting the __Filter__ property to *null* resets any filtering and all items will be visible.
@@ -64,59 +42,9 @@ Another option to filter the items is to specify the FilterExpression property.
#### Setting the FilterExpression property
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=expression}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=expression}}
-
-````C#
-this.radListControl1.FilterExpression = "Country LIKE 'Argentina'";
-
-````
-````VB.NET
-Me.radListControl1.FilterExpression = "Country LIKE 'Argentina'"
-'#End Region
-End Sub
-'#Region "Binding"
-Public Class Item
-Public Property Id() As Integer
- Get
- Return m_Id
- End Get
- Set(value As Integer)
- m_Id = value
- End Set
-End Property
-Private m_Id As Integer
-Public Property Description() As String
- Get
- Return m_Description
- End Get
- Set(value As String)
- m_Description = value
- End Set
-End Property
-Private m_Description As String
-Public Sub New(id As Integer, description As String)
- Me.Id = id
- Me.Description = description
-End Sub
-End Class
-Public Sub Bind()
-Dim items As New List(Of Item)()
-For i As Integer = 0 To 9
- items.Add(New Item(i, "Data" + i))
-Next
-radListControl1.DataSource = items
-radListControl1.DisplayMember = "Description"
-radListControl1.ValueMember = "Id"
-End Sub
-'#End Region
-'#region creatingVisualListItem
-Private Sub radListControl1_CreatingVisualListItem(ByVal sender As Object, ByVal args As CreatingVisualListItemEventArgs)
-args.VisualItem = New CustomVisualItem()
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
>note The __RadListControl.FilterExpression__ property value resembles a SQL expression.
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/searching.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/searching.md
index b8f04bbb7..3343091e2 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/searching.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/searching.md
@@ -14,36 +14,20 @@ __RadListControl__ can search for an item with the __FindString__ and __FindStri
#### Searching an item
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=searching}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=searching}}
+
+
-````C#
-int index = radListControl1.FindString("someitem");
-````
-````VB.NET
-Dim index As Integer = radListControl1.FindString("someitem")
-````
-
-{{endregion}}
This method call will return the index of the first item with *"someitem"* as its text or *-1* if no item has been found. The second overload is called like this:
#### Searching after a given index
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=index}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=index}}
-
-````C#
-int index = radListControl1.FindString("someitem", 5);
+
+
-````
-````VB.NET
-Dim index As Integer = radListControl1.FindString("someitem", 5)
-````
-{{endregion}}
The second argument specifies the index after which the search will start. This means that in this case, the search will start at index 6. An important fact is that __FindString__ method uses a wrapping linear search algorithm. If the item is not found when the end of the items collection is reached, it wraps and continues the search from the beginning until the start index is reached. Users can also search for an item with the keyboard. Setting the __KeyboardSearchEnabled__ property to *true* will cause __RadListControl__ to process keystrokes, build a string by appending each keystroke and then use the built string to find an item. Every keystroke initiates a new search starting at the last found item. This feature is also known as incremental search. The __KeyboardSearchResetInterval__ property can be set in order to define how long the user must wait after pressing a key in order for the search to start from the beginning and for the built string to be destroyed.
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/selection.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/selection.md
index 82366b93d..a06970c48 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/selection.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/selection.md
@@ -20,42 +20,22 @@ The selection in __RadListControl__ is determined by the __SelectionMode__ prope
>note There is **ActiveItem** property that gets or sets the active item. The **ActiveItem** is relevant only for **MultiSimple** and **MultiExtended** selection modes.
#### Set the selection mode
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=SelectionMode}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=SelectionMode}}
-````C#
-this.radListControl1.SelectionMode = SelectionMode.MultiSimple;
+
+
-````
-````VB.NET
-Me.radListControl1.SelectionMode = SelectionMode.MultiSimple
-````
-
-{{endregion}}
## Select items programmatically
In order to select an item programmatically you should use the **SelectedItem** property. You can select an item by index as well by using the **SelectedIndex** property. If you want to select an item by its value you can use the **SelectedValue** property. When usng the **SelectedValue** property a linear search is performed to find a data item that has the same value in its **Value** property.
#### Select items programmatically
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=SelectItems}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=SelectItems}}
-
-````C#
-this.radListControl1.SelectedItem = this.radListControl1.Items[1];
-this.radListControl1.SelectedIndex = 2;
-this.radListControl1.SelectedValue = "MP3";
-````
-````VB.NET
-Me.radListControl1.SelectedItem = Me.radListControl1.Items(1)
-Me.radListControl1.SelectedIndex = 2
-Me.radListControl1.SelectedValue = "MP3"
+
+
-````
-{{endregion}}

diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/sorting.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/sorting.md
index a8de8adc3..15c52b5bd 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/sorting.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/features/sorting.md
@@ -27,18 +27,10 @@ Sorting in __RadListControl__ is controlled by the __SortStyle__ property. The a
#### Setting Sorting
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=sorting}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=sorting}}
+
+
-````C#
-radListControl1.SortStyle = Telerik.WinControls.Enumerations.SortStyle.Ascending;
-````
-````VB.NET
-radListControl1.SortStyle = Telerik.WinControls.Enumerations.SortStyle.Ascending
-````
-
-{{endregion}}
>caution Changing the __SortStyle__ property may cause the __SelectedIndexChanged__ event to fire if the position of the currently selected item has changed after the sort operation.
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/getting-started.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/getting-started.md
index bf58ba654..e494bb75d 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/getting-started.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/getting-started.md
@@ -66,26 +66,9 @@ This tutorial demonstrates how to manually populate __RadListControl__ and how
#### Handling the SelectedIndexChanged event
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=handlingSelectedIndexChanged}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=handlingSelectedIndexChanged}}
-
-````C#
-void radListControl1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
-{
- RadListDataItem item = this.radListControl1.SelectedItem as RadListDataItem;
- radLabel1.Text = "Selected control: " + item.Text;
-}
-
-````
-````VB.NET
-Private Sub radListControl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.Data.PositionChangedEventArgs)
- Dim item As RadListDataItem = TryCast(Me.radListControl1.SelectedItem, RadListDataItem)
- radLabel1.Text = "Selected control: " & item.Text
-End Sub
-
-````
-
-{{endregion}}
+
+
+
11\. Press __F5__ to run the project. Select an item in the list box and note the value of the label.
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/populating-with-data/adding-items-programmatically.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/populating-with-data/adding-items-programmatically.md
index c164d8992..49f130a50 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/populating-with-data/adding-items-programmatically.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/populating-with-data/adding-items-programmatically.md
@@ -26,79 +26,11 @@ You can use one of the following item types:
#### Add items programmatically
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=AddItemsProgrammatically}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=AddItemsProgrammatically}}
-
-````C#
-DescriptionTextListDataItem descriptionItem = new DescriptionTextListDataItem();
-descriptionItem.Text = "Chicken wings";
-descriptionItem.Image = Properties.Resources.chicken_wings;
-descriptionItem.DescriptionText = "some description";
-this.radListControl1.Items.Add(descriptionItem);
-RadListDataItem dataItem = new RadListDataItem();
-dataItem.Text = "Chicken toast";
-dataItem.Image = Properties.Resources.chicken_toast;
-this.radListControl1.Items.Add(dataItem);
-
-````
-````VB.NET
-Dim descriptionItem As New DescriptionTextListDataItem()
-descriptionItem.Text = "Chicken wings"
-descriptionItem.Image = My.Resources.chicken_wings
-descriptionItem.DescriptionText = "some description"
-Me.radListControl1.Items.Add(descriptionItem)
-Dim dataItem As New RadListDataItem()
-dataItem.Text = "Chicken toast"
-dataItem.Image = My.Resources.chicken_toast
-Me.radListControl1.Items.Add(dataItem)
-'#End Region
-'#Region "expression"
-Me.radListControl1.FilterExpression = "Country LIKE 'Argentina'"
-'#End Region
-End Sub
-'#Region "Binding"
-Public Class Item
-Public Property Id() As Integer
- Get
- Return m_Id
- End Get
- Set(value As Integer)
- m_Id = value
- End Set
-End Property
-Private m_Id As Integer
-Public Property Description() As String
- Get
- Return m_Description
- End Get
- Set(value As String)
- m_Description = value
- End Set
-End Property
-Private m_Description As String
-Public Sub New(id As Integer, description As String)
- Me.Id = id
- Me.Description = description
-End Sub
-End Class
-Public Sub Bind()
-Dim items As New List(Of Item)()
-For i As Integer = 0 To 9
- items.Add(New Item(i, "Data" + i))
-Next
-radListControl1.DataSource = items
-radListControl1.DisplayMember = "Description"
-radListControl1.ValueMember = "Id"
-End Sub
-'#End Region
-'#region creatingVisualListItem
-Private Sub radListControl1_CreatingVisualListItem(ByVal sender As Object, ByVal args As CreatingVisualListItemEventArgs)
-args.VisualItem = New CustomVisualItem()
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
+
# See Also
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/populating-with-data/databinding.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/populating-with-data/databinding.md
index 335417dd9..6c96f189e 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/populating-with-data/databinding.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/populating-with-data/databinding.md
@@ -43,76 +43,10 @@ You can set the __DataSource__ property at design time in the *Properties* windo
## Data binding at run time
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=Binding}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=Binding}}
-
-````C#
-public class Item
-{
- public int Id { get; set; }
- public string Description { get; set; }
- public Item(int id, string description)
- {
- this.Id = id;
- this.Description = description;
- }
-}
-public void Bind()
-{
- List items = new List();
- for (int i = 0; i < 10; i++)
- {
- items.Add(new Item(i, "Data" + i));
- }
- radListControl1.DataSource = items;
- radListControl1.DisplayMember = "Description";
- radListControl1.ValueMember = "Id";
-}
-
-````
-````VB.NET
-Public Class Item
- Public Property Id() As Integer
- Get
- Return m_Id
- End Get
- Set(value As Integer)
- m_Id = value
- End Set
- End Property
- Private m_Id As Integer
- Public Property Description() As String
- Get
- Return m_Description
- End Get
- Set(value As String)
- m_Description = value
- End Set
- End Property
- Private m_Description As String
- Public Sub New(id As Integer, description As String)
- Me.Id = id
- Me.Description = description
- End Sub
-End Class
-Public Sub Bind()
- Dim items As New List(Of Item)()
- For i As Integer = 0 To 9
- items.Add(New Item(i, "Data" + i))
- Next
- radListControl1.DataSource = items
- radListControl1.DisplayMember = "Description"
- radListControl1.ValueMember = "Id"
-End Sub
-'#End Region
-'#region creatingVisualListItem
-Private Sub radListControl1_CreatingVisualListItem(ByVal sender As Object, ByVal args As CreatingVisualListItemEventArgs)
- args.VisualItem = New CustomVisualItem()
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
>caption Figure: 4 RadListControl bound at Run time
diff --git a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/visual-data-representation.md b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/visual-data-representation.md
index 025623037..9d4777058 100644
--- a/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/visual-data-representation.md
+++ b/controls/dropdown-listcontrol-and-checkeddropdownlist/listcontrol/visual-data-representation.md
@@ -21,57 +21,10 @@ Here is how our visual item class could look like:
#### Custom RadListVisualItem
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=customVisualItem}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=customVisualItem}}
+
+
-````C#
-public class CustomVisualItem : RadListVisualItem
-{
- private RadCheckBoxElement checkBox = null;
- static CustomVisualItem()
- {
- RadListVisualItem.SynchronizationProperties.Add(CustomDataItem.AvailableProperty);
- }
- protected override void PropertySynchronized(RadProperty property)
- {
- base.PropertySynchronized(property);
- if (property == CustomDataItem.AvailableProperty)
- {
- this.checkBox.Checked = (bool)this.GetValue(property);
- }
- }
- protected override void CreateChildElements()
- {
- base.CreateChildElements();
- this.checkBox = new RadCheckBoxElement();
- this.Children.Add(checkBox);
- }
-}
-
-````
-````VB.NET
-Public Class CustomVisualItem
-Inherits RadListVisualItem
- Private checkBox As RadCheckBoxElement = Nothing
- Shared Sub New()
- RadListVisualItem.SynchronizationProperties.Add(CustomDataItem.AvailableProperty)
- End Sub
- Protected Overrides Sub PropertySynchronized(ByVal [property] As RadProperty)
- MyBase.PropertySynchronized([property])
- If [property] Is CustomDataItem.AvailableProperty Then
- Me.checkBox.Checked = CBool(Me.GetValue([property]))
- End If
- End Sub
- Protected Overrides Sub CreateChildElements()
- MyBase.CreateChildElements()
- Me.checkBox = New RadCheckBoxElement()
- Me.Children.Add(checkBox)
- End Sub
-End Class
-
-````
-
-{{endregion}}
+
Two things are important in order for the synchronization to work. First, the base __RadListVisualItem__ has a static list of __RadProperty__ objects that are iterated over and for each property in the list, the property value is synchronized between the logical and the visual item. In order for the custom __Available__ property to take part in this synchronization it must be added to the static list which should be done in the static constructor of the __CustomVisualItem__. Second, after this property is added to the static property list, the base implementation will notify the inheritors who override the __PropertySynchronized__ method. In this method we can get the updated value for the custom property and update the visual elements accordingly. Again, the two necessary steps to perform are to add the new property to the property list and to override __PropertySynchronized__ so that we can update the UI. The property synchronization works only one way, from the data to the visuals. If the visuals are updated the programmer who created the new visual item is responsible for updating the data item. Every __RadListVisualItem__ has a __Data__ property that points to the data item. It is an interface reference and if a custom data item is provided, it must be explicitly cast to the correct type.
@@ -81,24 +34,10 @@ Once we have created a custom visual item, we need to subscribe to the __Creatin
#### Replace the default visual items
-{{source=..\SamplesCS\DropDownListControl\ListControl\ListControl1.cs region=creatingVisualListItem}}
-{{source=..\SamplesVB\DropDownListControl\ListControl\ListControl1.vb region=creatingVisualListItem}}
-
-````C#
-void radListControl1_CreatingVisualListItem(object sender, CreatingVisualListItemEventArgs args)
-{
- args.VisualItem = new CustomVisualItem();
-}
-
-````
-````VB.NET
-Private Sub radListControl1_CreatingVisualListItem(ByVal sender As Object, ByVal args As CreatingVisualListItemEventArgs)
- args.VisualItem = New CustomVisualItem()
-End Sub
-
-````
+
+
-{{endregion}}
+
This is all there is to it, with that infrastructure in place users can create just about any visual representation of the data that __RadListControl__ is bound to or filled with in unbound mode.
diff --git a/controls/editors/autocompletebox/auto-complete.md b/controls/editors/autocompletebox/auto-complete.md
index e35f24e3a..352c5968d 100644
--- a/controls/editors/autocompletebox/auto-complete.md
+++ b/controls/editors/autocompletebox/auto-complete.md
@@ -65,55 +65,11 @@ __AutoCompleteValueMember__: To set the __AutoCompleteValueMember__ property, fi
To use auto-completion without specifying a data source, you need to populate the items which will be used for completing the input string in RadAutoCompleteBox in the __Items__ collection of the control:
-{{source=..\SamplesCS\Editors\AutoCompleteBox.cs region=addItems}}
-{{source=..\SamplesVB\Editors\AutoCompleteBox.vb region=addItems}}
-
-````C#
-private void AddAutoCompleteItems()
-{
- RadListDataItemCollection items = this.radAutoCompleteBox1.AutoCompleteItems;
- items.Add(new RadListDataItem("Joe Smith", "joe@fakecompany.com"));
- items.Add(new RadListDataItem("Adam Petersen", "adam@qwerty.com"));
- items.Add(new RadListDataItem("Jack Russel", "jack@russel.nocom"));
- items.Add(new RadListDataItem("Daniel Finger", "daniel.pinger@gmail.com"));
- items.Add(new RadListDataItem("Richard Vail", "rvail@richardvail.com"));
- items.Add(new RadListDataItem("Sebastian Jonnson", "s.jonnson@sjonnson.com"));
- items.Add(new RadListDataItem("Lee Cooper", "lee.cooper@coopercoorp.com"));
- items.Add(new RadListDataItem("Kelvin Clain", "kclain@clainkevin.com"));
- items.Add(new RadListDataItem("Maria Jenson", "mjenson@mariajenson.com"));
- items.Add(new RadListDataItem("Chelsea Maarten", "chelsea@maarten.com"));
- items.Add(new RadListDataItem("Jenson Chew", "jenson.chew@nospam.com"));
- items.Add(new RadListDataItem("Martin Williams", "m.williams@martinandwilliams.com"));
- items.Add(new RadListDataItem("Telerik", "clientservice@telerik.com"));
- items.Add(new RadListDataItem("James Stone", "james.stone@manystones.com"));
- items.Add(new RadListDataItem("Samuel Jackson", "samuel.jackson@nojackson.com"));
-}
-
-````
-````VB.NET
-Private Sub AddAutoCompleteItems()
- Dim items As RadListDataItemCollection = Me.RadAutoCompleteBox1.AutoCompleteItems
- items.Add(New RadListDataItem("Joe Smith", "joe@fakecompany.com"))
- items.Add(New RadListDataItem("Adam Petersen", "adam@qwerty.com"))
- items.Add(New RadListDataItem("Jack Russel", "jack@russel.nocom"))
- items.Add(New RadListDataItem("Daniel Finger", "daniel.pinger@gmail.com"))
- items.Add(New RadListDataItem("Richard Vail", "rvail@richardvail.com"))
- items.Add(New RadListDataItem("Sebastian Jonnson", "s.jonnson@sjonnson.com"))
- items.Add(New RadListDataItem("Lee Cooper", "lee.cooper@coopercoorp.com"))
- items.Add(New RadListDataItem("Kelvin Clain", "kclain@clainkevin.com"))
- items.Add(New RadListDataItem("Maria Jenson", "mjenson@mariajenson.com"))
- items.Add(New RadListDataItem("Chelsea Maarten", "chelsea@maarten.com"))
- items.Add(New RadListDataItem("Jenson Chew", "jenson.chew@nospam.com"))
- items.Add(New RadListDataItem("Martin Williams", "m.williams@martinandwilliams.com"))
- items.Add(New RadListDataItem("Telerik", "clientservice@telerik.com"))
- items.Add(New RadListDataItem("James Stone", "james.stone@manystones.com"))
- items.Add(New RadListDataItem("Samuel Jackson", "samuel.jackson@nojackson.com"))
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
+
>caption Figure 2: RadAutoCompleteBox with some items added directly.

@@ -128,29 +84,9 @@ As of **R1 2020 SP1** **RadAutoCompleteBox** offers the **AllowDuplicates** prop
Note that you can still add duplicated tokens in the editor if you type them manually. In order to avoid that you can subscribe to **TokenValidating** event and if the existing text in **RadAutoCompleteBox** contains the new text, set the **IsValidToken** property to *false*. The **TokenValidating** event will be called for each token that is going to be added to the control text area.
-{{source=..\SamplesCS\Editors\AutoCompleteBox.cs region=InvalidToken}}
-{{source=..\SamplesVB\Editors\AutoCompleteBox.vb region=InvalidToken}}
-
-````C#
- private void RadAutoCompleteBox1_TokenValidating(object sender, TokenValidatingEventArgs e)
- {
- if (this.radAutoCompleteBox1.Text.Contains(e.Text))
- {
- e.IsValidToken = false;
- }
- }
-
-````
-````VB.NET
- Private Sub RadAutoCompleteBox1_TokenValidating(ByVal sender As Object, ByVal e As TokenValidatingEventArgs)
- If Me.radAutoCompleteBox1.Text.Contains(e.Text) Then
- e.IsValidToken = False
- End If
- End Sub
-
-````
-
-{{endregion}}
+
+
+
# See Also
diff --git a/controls/editors/autocompletebox/caret-positioning-and-selection.md b/controls/editors/autocompletebox/caret-positioning-and-selection.md
index 24093fd03..84c4c6c55 100644
--- a/controls/editors/autocompletebox/caret-positioning-and-selection.md
+++ b/controls/editors/autocompletebox/caret-positioning-and-selection.md
@@ -22,51 +22,17 @@ The __SelectionStart__ property is an integer that indicates the insertion point
Setting the __SelectionLength__ to a number greater than 0 causes that number of characters to be selected, starting from the current insertion point.
-{{source=..\SamplesCS\editors\AutoCompleteBox.cs region=SetSelection}}
-{{source=..\SamplesVB\editors\AutoCompleteBox.vb region=SetSelection}}
+
+
-````C#
-private void SetSelection()
-{
- this.radAutoCompleteBox1.Text = "Pepsi; Sprite; Coca-Cola;";
- this.radAutoCompleteBox1.SelectionStart = 6;
- this.radAutoCompleteBox1.SelectionLength = 7;
-}
-````
-````VB.NET
-Private Sub SetSelection()
- Me.RadAutoCompleteBox1.Text = "Pepsi; Sprite; Coca-Cola;"
- Me.RadAutoCompleteBox1.SelectionStart = 6
- Me.RadAutoCompleteBox1.SelectionLength = 7
-End Sub
-
-````
-
-{{endregion}}
Alternatively, you can use the __Select__ method to select the same part of the text:
-{{source=..\SamplesCS\editors\AutoCompleteBox.cs region=SetSelectionRange}}
-{{source=..\SamplesVB\editors\AutoCompleteBox.vb region=SetSelectionRange}}
-
-````C#
-private void SetSelectionRange()
-{
- this.radAutoCompleteBox1.Text = "Pepsi;Sprite;Coca-Cola";
- this.radAutoCompleteBox1.Select(6, 7);
-}
-
-````
-````VB.NET
-Private Sub SetSelectionRange()
- Me.RadAutoCompleteBox1.Text = "Pepsi;Sprite;Coca-Cola"
- Me.RadAutoCompleteBox1.[Select](6, 7)
-End Sub
+
+
-````
-{{endregion}}
The both approaches produce same result:
diff --git a/controls/editors/autocompletebox/creating-custom-blocks.md b/controls/editors/autocompletebox/creating-custom-blocks.md
index 3174eb336..91a0b637b 100644
--- a/controls/editors/autocompletebox/creating-custom-blocks.md
+++ b/controls/editors/autocompletebox/creating-custom-blocks.md
@@ -16,102 +16,28 @@ __RadAutoCompleteBox__ allows not only appearance customization via the formatti
You should create a custom text block that inherits from __ITextBlock__ and any inheritor of __RadElement__. Let’s extend the default __TokenizedTextBlockElement__ by adding a check box. You don’t need to implement the __ITextBlock__ interface, because it is already defined in the base class:
-{{source=..\SamplesCS\Editors\AutoCompleteBox.cs region=customTokens}}
-{{source=..\SamplesVB\Editors\AutoCompleteBox.vb region=customTokens}}
-
-````C#
-public class MyTokenizedTextBlockElement : TokenizedTextBlockElement
-{
- private RadCheckBoxElement checkBox;
- protected override Type ThemeEffectiveType
- {
- get
- {
- return typeof(TokenizedTextBlockElement);
- }
- }
- protected override void CreateChildElements()
- {
- base.CreateChildElements();
- int index = this.Children.IndexOf(this.RemoveButton);
- this.checkBox = new RadCheckBoxElement();
- this.checkBox.StretchVertically = true;
- this.checkBox.StretchHorizontally = false;
- this.Children.Insert(index, this.checkBox);
- }
-}
-
-````
-````VB.NET
-Public Class MyTokenizedTextBlockElement
- Inherits TokenizedTextBlockElement
- Private checkBox As RadCheckBoxElement
- Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
- Get
- Return GetType(TokenizedTextBlockElement)
- End Get
- End Property
- Protected Overrides Sub CreateChildElements()
- MyBase.CreateChildElements()
- Dim index As Integer = Me.Children.IndexOf(Me.RemoveButton)
- Me.checkBox = New RadCheckBoxElement()
- Me.checkBox.StretchVertically = True
- Me.checkBox.StretchHorizontally = False
- Me.Children.Insert(index, Me.checkBox)
- End Sub
-End Class
-
-````
-
-{{endregion}}
+
+
+
+
Then you should replace the default text block in the __CreateTextBlock__ event handler, in the following manner:
-{{source=..\SamplesCS\Editors\AutoCompleteBox.cs region=replaceTokens}}
-{{source=..\SamplesVB\Editors\AutoCompleteBox.vb region=replaceTokens}}
-
-````C#
-private void radAutoCompleteBox1_CreateTextBlock(object sender, CreateTextBlockEventArgs e)
-{
- if (e.TextBlock is TokenizedTextBlockElement)
- {
- e.TextBlock = new MyTokenizedTextBlockElement();
- }
-}
-
-````
-````VB.NET
-Private Sub radAutoCompleteBox1_CreateTextBlock(sender As Object, e As CreateTextBlockEventArgs)
- If TypeOf e.TextBlock Is TokenizedTextBlockElement Then
- e.TextBlock = New MyTokenizedTextBlockElement()
- End If
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
+
Finally, the text property should be set:
>note The subscription to the event, should be introduced before setting the text of the control.
>
-{{source=..\SamplesCS\Editors\AutoCompleteBox.cs region=SubscribeToCreateTextBlock}}
-{{source=..\SamplesVB\Editors\AutoCompleteBox.vb region=SubscribeToCreateTextBlock}}
-````C#
-radAutoCompleteBox1.CreateTextBlock+=new CreateTextBlockEventHandler(radAutoCompleteBox1_CreateTextBlock);
-this.radAutoCompleteBox1.Text = "Euro;USD;GBP;";
-
-````
-````VB.NET
-AddHandler RadAutoCompleteBox1.CreateTextBlock, AddressOf radAutoCompleteBox1_CreateTextBlock
-Me.RadAutoCompleteBox1.Text = "Euro;USD;GBP;"
-
-````
+
+
-{{endregion}}
The following image demonstrates the final result:
diff --git a/controls/editors/autocompletebox/customizing-appearance/formatting-blocks.md b/controls/editors/autocompletebox/customizing-appearance/formatting-blocks.md
index a87377a4e..e63ad0c28 100644
--- a/controls/editors/autocompletebox/customizing-appearance/formatting-blocks.md
+++ b/controls/editors/autocompletebox/customizing-appearance/formatting-blocks.md
@@ -13,33 +13,10 @@ previous_url: editors-autocompletetextbox-formatting-blocks, editors/autocomplet
The __RadAutoCompleteBox__ allows appearance customization of each instance of __ITextBlock__. This can be easily achieved by subscribing to the __FormattingTextBlock__ event:
-{{source=..\SamplesCS\Editors\AutoCompleteBox.cs region=formatting}}
-{{source=..\SamplesVB\Editors\AutoCompleteBox.vb region=formatting}}
-
-````C#
-void radAutoCompleteBox1_TextBlockFormatting(object sender, TextBlockFormattingEventArgs e)
-{
- TokenizedTextBlockElement token = e.TextBlock as TokenizedTextBlockElement;
- if (token != null)
- {
- token.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
- token.BackColor = Color.Yellow;
- }
-}
-
-````
-````VB.NET
-Private Sub radAutoCompleteBox1_TextBlockFormatting(sender As Object, e As TextBlockFormattingEventArgs)
- Dim token As TokenizedTextBlockElement = TryCast(e.TextBlock, TokenizedTextBlockElement)
- If token IsNot Nothing Then
- token.GradientStyle = Telerik.WinControls.GradientStyles.Solid
- token.BackColor = Color.Yellow
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
>caption Figure 1: Items with yellow background.
diff --git a/controls/editors/autocompletebox/getting-started.md b/controls/editors/autocompletebox/getting-started.md
index b7aa2b0fe..80871bc71 100644
--- a/controls/editors/autocompletebox/getting-started.md
+++ b/controls/editors/autocompletebox/getting-started.md
@@ -45,44 +45,21 @@ Each tokenized text block is separated by character, specified by the __Delimite
The code below sets text in the control at run time:
-{{source=..\SamplesCS\editors\AutoCompleteBox.cs region=SetText}}
-{{source=..\SamplesVB\editors\AutoCompleteBox.vb region=SetText}}
+
+
-````C#
-private void SetText()
-{
- this.radAutoCompleteBox1.Text = "Germany;USA;Brazil;Bulgaria;Croatia;Serbia;";
-}
-````
-````VB.NET
-Private Sub SetText()
- Me.RadAutoCompleteBox1.Text = "Germany;USA;Brazil;Bulgaria;Croatia;Serbia;"
-End Sub
-````
-
-{{endregion}}
-
>caption Figure 1: Set the text of RadAutoCompleteBox.

You can determine the visibility of the remove button by changing the __ShowRemoveButton__ property:
-{{source=..\SamplesCS\editors\AutoCompleteBox.cs region=ShowRemoveButton}}
-{{source=..\SamplesVB\editors\AutoCompleteBox.vb region=ShowRemoveButton}}
-
-````C#
-this.radAutoCompleteBox1.ShowRemoveButton = false;
-
-````
-````VB.NET
-Me.RadAutoCompleteBox1.ShowRemoveButton = False
+
+
-````
-{{endregion}}
>caption Figure 2: The Tokenized items are not showing the close button.
diff --git a/controls/editors/autocompletebox/text-editing.md b/controls/editors/autocompletebox/text-editing.md
index 4086a8bda..3bab391c9 100644
--- a/controls/editors/autocompletebox/text-editing.md
+++ b/controls/editors/autocompletebox/text-editing.md
@@ -18,29 +18,11 @@ You can insert text programmatically at concrete position by using the __Insert_
#### Using the Insert method.
-{{source=..\SamplesCS\editors\AutoCompleteBox.cs region=insert}}
-{{source=..\SamplesVB\editors\AutoCompleteBox.vb region=insert}}
-
-````C#
-private void Insert()
-{
- this.radAutoCompleteBox1.Text = "USA;";
- this.radAutoCompleteBox1.CaretIndex = 0;
- this.radAutoCompleteBox1.Insert("Canada;");
-}
-
-````
-````VB.NET
-Private Sub Insert()
- Me.RadAutoCompleteBox1.Text = "USA;"
- Me.RadAutoCompleteBox1.CaretIndex = 0
- Me.RadAutoCompleteBox1.Insert("Canada;")
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
+
>caption Figure 1: Inserting text.

@@ -49,27 +31,11 @@ Alternatively, you can insert text at the end of the __RadAutoCompleteBox__ cont
#### Using the AppendText method.
-{{source=..\SamplesCS\editors\AutoCompleteBox.cs region=Append}}
-{{source=..\SamplesVB\editors\AutoCompleteBox.vb region=Append}}
+
+
-````C#
-private void Append()
-{
- this.radAutoCompleteBox1.Text = "IT Department;";
- this.radAutoCompleteBox1.AppendText("Marketing Team;");
-}
-````
-````VB.NET
-Private Sub Append()
- Me.RadAutoCompleteBox1.Text = "IT Department;"
- Me.RadAutoCompleteBox1.AppendText("Marketing Team;")
-End Sub
-````
-
-{{endregion}}
-
>caption Figure 2: The text is appended at the end.

@@ -78,29 +44,11 @@ You can delete the selected text or character at the caret position by using the
#### Using the Delete method.
-{{source=..\SamplesCS\editors\AutoCompleteBox.cs region=Delete}}
-{{source=..\SamplesVB\editors\AutoCompleteBox.vb region=Delete}}
-
-````C#
-private void DeleteText()
-{
- this.radAutoCompleteBox1.Text = "Germany;USA;Brazil;Bulgaria;Croatia;Serbia;";
- this.radAutoCompleteBox1.Select(0, 8);
- this.radAutoCompleteBox1.Delete();
-}
-
-````
-````VB.NET
-Private Sub DeleteText()
- Me.RadAutoCompleteBox1.Text = "Germany;USA;Brazil;Bulgaria;Croatia;Serbia;"
- Me.RadAutoCompleteBox1.[Select](0, 8)
- Me.RadAutoCompleteBox1.Delete()
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
+
>caption Figure 3: The firs word is deleted.

@@ -109,24 +57,10 @@ Each editing operation raises the __TextChanging__ and __TextChanged__ events. N
#### Prevent deleting a tokenized text blocks in RadAutoCompleteBox.
-{{source=..\SamplesCS\editors\AutoCompleteBox.cs region=PreventDeleteOfTokens}}
-{{source=..\SamplesVB\editors\AutoCompleteBox.vb region=PreventDeleteOfTokens}}
-
-````C#
-void radAutoCompleteBox1_TextChanging(object sender, Telerik.WinControls.TextChangingEventArgs e)
-{
- e.Cancel = string.IsNullOrEmpty(e.NewValue) && e.OldValue.Contains(this.radAutoCompleteBox1.Delimiter.ToString());
-}
-
-````
-````VB.NET
-Private Sub radAutoCompleteBox1_TextChanging(sender As Object, e As Telerik.WinControls.TextChangingEventArgs)
- e.Cancel = String.IsNullOrEmpty(e.NewValue) AndAlso e.OldValue.Contains(Me.RadAutoCompleteBox1.Delimiter.ToString())
-End Sub
+
+
-````
-{{endregion}}
The code above prevents deleting a tokenized text blocks in RadAutoCompleteBox.
diff --git a/controls/editors/browseeditor/customizing-appearance/accessing-and-customizing-elements.md b/controls/editors/browseeditor/customizing-appearance/accessing-and-customizing-elements.md
index 7fdc95b16..a84c5baa0 100644
--- a/controls/editors/browseeditor/customizing-appearance/accessing-and-customizing-elements.md
+++ b/controls/editors/browseeditor/customizing-appearance/accessing-and-customizing-elements.md
@@ -30,22 +30,10 @@ You can customize the nested elements at run time as well:
#### Customize elements
-{{source=..\SamplesCS\Editors\BrowseEditor1.cs region=CustomizeElementProgrammatically}}
-{{source=..\SamplesVB\Editors\BrowseEditor1.vb region=CustomizeElementProgrammatically}}
-````C#
-this.radBrowseEditor1.BrowseElement.BrowseButton.ButtonFillElement.NumberOfColors = 1;
-this.radBrowseEditor1.BrowseElement.BrowseButton.ButtonFillElement.BackColor = Color.LightGreen;
+
+
-````
-````VB.NET
-Me.RadBrowseEditor1.BrowseElement.BrowseButton.ButtonFillElement.NumberOfColors = 1
-Me.RadBrowseEditor1.BrowseElement.BrowseButton.ButtonFillElement.BackColor = Color.LightGreen
-````
-
-
-
-{{endregion}}
# See Also
diff --git a/controls/editors/browseeditor/dialog-types.md b/controls/editors/browseeditor/dialog-types.md
index ed11efb1e..97cedd339 100644
--- a/controls/editors/browseeditor/dialog-types.md
+++ b/controls/editors/browseeditor/dialog-types.md
@@ -26,20 +26,10 @@ As of **R1 2020 SP1** the Telerik [File Dialogs]({%slug winforms/file-dialogs/ov
#### FolderBrowseDialog
-{{source=..\SamplesCS\Editors\BrowseEditor1.cs region=FolderBrowseDialog}}
-{{source=..\SamplesVB\Editors\BrowseEditor1.vb region=FolderBrowseDialog}}
-````C#
-this.radBrowseEditor1.DialogType = BrowseEditorDialogType.FolderBrowseDialog;
+
+
-````
-````VB.NET
-Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.FolderBrowseDialog
-````
-
-
-
-{{endregion}}
>caption Figure 1: FolderBrowseDialog
@@ -47,20 +37,10 @@ Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.FolderBrowseDialog
#### FontDialog
-{{source=..\SamplesCS\Editors\BrowseEditor1.cs region=FontDialog}}
-{{source=..\SamplesVB\Editors\BrowseEditor1.vb region=FontDialog}}
-````C#
-this.radBrowseEditor1.DialogType = BrowseEditorDialogType.FontDialog;
-
-````
-````VB.NET
-Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.FontDialog
-
-````
-
+
+
-{{endregion}}
>caption Figure 2: FontDialog
@@ -68,20 +48,10 @@ Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.FontDialog
#### OpenFileDialog
-{{source=..\SamplesCS\Editors\BrowseEditor1.cs region=OpenFileDialog}}
-{{source=..\SamplesVB\Editors\BrowseEditor1.vb region=OpenFileDialog}}
-````C#
-this.radBrowseEditor1.DialogType = BrowseEditorDialogType.OpenFileDialog;
+
+
-````
-````VB.NET
-Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.OpenFileDialog
-````
-
-
-
-{{endregion}}
>caption Figure 3: OpenFileDialog
@@ -89,17 +59,10 @@ Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.OpenFileDialog
#### SaveFileDialog
-{{source=..\SamplesCS\Editors\BrowseEditor1.cs region=SaveFileDialog}}
-{{source=..\SamplesVB\Editors\BrowseEditor1.vb region=SaveFileDialog}}
-````C#
-this.radBrowseEditor1.DialogType = BrowseEditorDialogType.SaveFileDialog;
+
+
-````
-````VB.NET
-Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.SaveFileDialog
-````
-{{endregion}}
>caption Figure 4: SaveFileDialog
@@ -108,18 +71,10 @@ Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.SaveFileDialog
#### RadOpenFileDialog
-{{source=..\SamplesCS\Editors\BrowseEditor1.cs region=TelerikOpenFileDialog}}
-{{source=..\SamplesVB\Editors\BrowseEditor1.vb region=TelerikOpenFileDialog}}
+
+
-````C#
-this.radBrowseEditor1.DialogType = BrowseEditorDialogType.RadOpenFileDialog;
-````
-````VB.NET
-Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.RadOpenFileDialog
-
-````
-{{endregion}}
>caption Figure 5: RadOpenFileDialog
@@ -127,18 +82,10 @@ Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.RadOpenFileDialog
#### RadOpenFolderDialog
-{{source=..\SamplesCS\Editors\BrowseEditor1.cs region=TelerikOpenFolderDialog}}
-{{source=..\SamplesVB\Editors\BrowseEditor1.vb region=TelerikOpenFolderDialog}}
-
-````C#
-this.radBrowseEditor1.DialogType = BrowseEditorDialogType.RadOpenFolderDialog;
+
+
-````
-````VB.NET
-Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.RadOpenFolderDialog
-````
-{{endregion}}
>caption Figure 6: RadOpenFolderDialog
@@ -148,18 +95,10 @@ Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.RadOpenFolderDialog
#### RadSaveFileDialog
-{{source=..\SamplesCS\Editors\BrowseEditor1.cs region=TelerikSaveFileDialog}}
-{{source=..\SamplesVB\Editors\BrowseEditor1.vb region=TelerikSaveFileDialog}}
-
-````C#
- this.radBrowseEditor1.DialogType = BrowseEditorDialogType.RadSaveFileDialog;
+
+
-````
-````VB.NET
-Me.RadBrowseEditor1.DialogType = BrowseEditorDialogType.RadSaveFileDialog
-````
-{{endregion}}
>caption Figure 7: RadSaveFileDialog
diff --git a/controls/editors/browseeditor/getting-started.md b/controls/editors/browseeditor/getting-started.md
index 56a577881..5a8ebe07f 100644
--- a/controls/editors/browseeditor/getting-started.md
+++ b/controls/editors/browseeditor/getting-started.md
@@ -46,24 +46,10 @@ The following example demonstrates how to change the image of a __RadButton__ us
3\. Select the __RadBrowseEditor__, click the __Events tab__ of the __Property Window__, locate the __ValueChanged__ event and double-click it in order to create an event handler. Replace the event handler with the following code.
-{{source=..\SamplesCS\Editors\BrowseEditor1.cs region=browseEditorValueChanged}}
-{{source=..\SamplesVB\Editors\BrowseEditor1.vb region=browseEditorValueChanged}}
+
+
-````C#
-private void radBrowseEditor1_ValueChanged(object sender, EventArgs e)
-{
- this.radButton1.Image = Image.FromFile(this.radBrowseEditor1.Value);
-}
-````
-````VB.NET
-Private Sub RadBrowseEditor1_ValueChanged(sender As Object, e As EventArgs)
- Me.RadButton1.Image = System.Drawing.Image.FromFile(Me.RadBrowseEditor1.Value)
-End Sub
-
-````
-
-{{endregion}}
4\. Press __F5__ to run the application. Press the browse button and select an image. The image is then applied to the __RadButton__.
diff --git a/controls/editors/browseeditor/working-with-radbrowseeditor.md b/controls/editors/browseeditor/working-with-radbrowseeditor.md
index 4c1a2c912..1d4075cb9 100644
--- a/controls/editors/browseeditor/working-with-radbrowseeditor.md
+++ b/controls/editors/browseeditor/working-with-radbrowseeditor.md
@@ -15,25 +15,11 @@ The events defined in __RadBrowseEditor__ provide an easy way to track user inpu
#### Cancel ValueChanging Event
-{{source=..\SamplesCS\Editors\BrowseEditor1.cs region=browseEditorValueChanging}}
-{{source=..\SamplesVB\Editors\BrowseEditor1.vb region=browseEditorValueChanging}}
-
-````C#
-private void radBrowseEditor1_ValueChanging(object sender, ValueChangingEventArgs e)
-{
- e.Cancel = !File.Exists(e.NewValue.ToString());
-}
-
-````
-````VB.NET
-Private Sub RadBrowseEditor1_ValueChanging(sender As Object, e As Telerik.WinControls.UI.ValueChangingEventArgs)
- e.Cancel = Not System.IO.File.Exists(e.NewValue.ToString())
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
+
## See Also
* [Properties and Events]({%slug winforms/editors/browseeditor/properties-events%})
diff --git a/controls/editors/buttontextbox/customizing-appearance/accessing-and-customizing-elements.md b/controls/editors/buttontextbox/customizing-appearance/accessing-and-customizing-elements.md
index fa54b9f86..72d14f5bc 100644
--- a/controls/editors/buttontextbox/customizing-appearance/accessing-and-customizing-elements.md
+++ b/controls/editors/buttontextbox/customizing-appearance/accessing-and-customizing-elements.md
@@ -34,29 +34,5 @@ You can customize the nested elements at run time as well:
#### Customize elements
-{{source=..\SamplesCS\Editors\ButtonTextBox.cs region=CustomizeElements}}
-{{source=..\SamplesVB\Editors\ButtonTextBox.vb region=CustomizeElements}}
-
-````C#
-this.radButtonTextBox1.TextBoxElement.ForeColor = Color.Red;
-this.radButtonTextBox1.TextBoxElement.BackColor = Color.Yellow;
-RadButtonElement button = this.radButtonTextBox1.LeftButtonItems[0] as RadButtonElement;
-button.Text = "BUL";
-button.TextImageRelation = TextImageRelation.ImageBeforeText;
-button.ButtonFillElement.BackColor = Color.Fuchsia;
-button.ShowBorder = false;
-
-````
-````VB.NET
-Me.RadButtonTextBox1.TextBoxElement.ForeColor = Color.Red
-Me.RadButtonTextBox1.TextBoxElement.BackColor = Color.Yellow
-Dim button As RadButtonElement = TryCast(Me.RadButtonTextBox1.LeftButtonItems(0), RadButtonElement)
-button.Text = "BUL"
-button.TextImageRelation = TextImageRelation.ImageBeforeText
-button.ButtonFillElement.BackColor = Color.Fuchsia
-button.ShowBorder = False
-
-````
-
-{{endregion}}
-
+
+
\ No newline at end of file
diff --git a/controls/editors/buttontextbox/populating-with-items/adding-items-programmatically.md b/controls/editors/buttontextbox/populating-with-items/adding-items-programmatically.md
index ae997b414..e86cbb2ed 100644
--- a/controls/editors/buttontextbox/populating-with-items/adding-items-programmatically.md
+++ b/controls/editors/buttontextbox/populating-with-items/adding-items-programmatically.md
@@ -19,66 +19,10 @@ position: 1
#### Add button elements programmatically
-{{source=..\SamplesCS\Editors\ButtonTextBox.cs region=AddItemsProgrammatically}}
-{{source=..\SamplesVB\Editors\ButtonTextBox.vb region=AddItemsProgrammatically}}
-
-````C#
-Dictionary glyphs = new Dictionary();
-List buttons = new List();
-glyphs.Add(0, ""); //yammer
-glyphs.Add(1, ""); //twitter
-glyphs.Add(2, ""); //pinterest
-glyphs.Add(3, ""); //google
-glyphs.Add(4, ""); //facebook
-glyphs.Add(5, ""); //linkedin
-glyphs.Add(6, "\ue817"); //Reddit
-glyphs.Add(7, "\ue81d"); //Tumbler
-glyphs.Add(8, "\ue813"); // MySpace
-for (int i = 0; i < 9; i++)
-{
- RadButtonElement radButtonElement = new RadButtonElement();
- radButtonElement.DisplayStyle = Telerik.WinControls.DisplayStyle.Text;
- radButtonElement.TextElement.CustomFont = "TelerikWebUI";
- radButtonElement.TextElement.CustomFontSize = 10;
- radButtonElement.TextElement.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
- radButtonElement.Text = glyphs[i];
- buttons.Add(radButtonElement);
-}
-radButtonTextBox1.RightButtonItems.AddRange(buttons[0], buttons[1], buttons[3], buttons[4]);
-radButtonTextBox1.LeftButtonItems.AddRange(buttons[5], buttons[6], buttons[7], buttons[8]);
-radButtonTextBox1.AutoSize = false;
-radButtonTextBox1.Text = "";
-
-````
-````VB.NET
-Dim glyphs As Dictionary(Of Integer, String) = New Dictionary(Of Integer, String)()
-Dim buttons As List(Of RadButtonElement) = New List(Of RadButtonElement)()
-glyphs.Add(0, "")
-glyphs.Add(1, "")
-glyphs.Add(2, "")
-glyphs.Add(3, "")
-glyphs.Add(4, "")
-glyphs.Add(5, "")
-glyphs.Add(6, "")
-glyphs.Add(7, "")
-glyphs.Add(8, "")
-For i As Integer = 0 To 9 - 1
- Dim radButtonElement As RadButtonElement = New RadButtonElement()
- radButtonElement.DisplayStyle = Telerik.WinControls.DisplayStyle.Text
- radButtonElement.TextElement.CustomFont = "TelerikWebUI"
- radButtonElement.TextElement.CustomFontSize = 10
- radButtonElement.TextElement.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias
- radButtonElement.Text = glyphs(i)
- buttons.Add(radButtonElement)
-Next
-RadButtonTextBox1.RightButtonItems.AddRange(buttons(0), buttons(1), buttons(3), buttons(4))
-RadButtonTextBox1.LeftButtonItems.AddRange(buttons(5), buttons(6), buttons(7), buttons(8))
-RadButtonTextBox1.AutoSize = False
-RadButtonTextBox1.Text = ""
-
-````
-
-{{endregion}}
+
+
+
+
The following code snippet demonstrates how to add programmatically different types of elements in **RadButtonTextBox**:
@@ -88,95 +32,10 @@ The following code snippet demonstrates how to add programmatically different ty
#### Add different elements programmatically
-{{source=..\SamplesCS\Editors\ButtonTextBox.cs region=AllItems}}
-{{source=..\SamplesVB\Editors\ButtonTextBox.vb region=AllItems}}
-
-````C#
-private void AddDifferentItems()
-{
- this.radButtonTextBox1.Multiline = true;
- RadButtonElement buttonElement = new RadButtonElement();
- buttonElement.Text = "Button";
- buttonElement.Click += buttonElement_Click;
- this.radButtonTextBox1.LeftButtonItems.Add(buttonElement);
- RadToggleButtonElement toggleButtonElement = new RadToggleButtonElement();
- toggleButtonElement.Text = "ToggleButton";
- toggleButtonElement.ToggleStateChanged += toggleButtonElement_ToggleStateChanged;
- this.radButtonTextBox1.LeftButtonItems.Add(toggleButtonElement);
- CommandBarSeparator separator = new CommandBarSeparator();
- this.radButtonTextBox1.LeftButtonItems.Add(separator);
- RadRepeatButtonElement repeatButtonElement = new RadRepeatButtonElement();
- repeatButtonElement.Text = "RepeatButton";
- repeatButtonElement.Click += repeatButtonElement_Click;
- this.radButtonTextBox1.LeftButtonItems.Add(repeatButtonElement);
- RadCheckBoxElement checkBoxElement = new RadCheckBoxElement();
- checkBoxElement.Text = "CheckBox";
- checkBoxElement.CheckStateChanged += checkBoxElement_CheckStateChanged;
- this.radButtonTextBox1.RightButtonItems.Add(checkBoxElement);
-}
-private void checkBoxElement_CheckStateChanged(object sender, EventArgs e)
-{
- RadMessageBox.Show("RRadCheckBoxElement is toggled");
-}
-private void repeatButtonElement_Click(object sender, EventArgs e)
-{
- Console.WriteLine("RadRepeatButtonElement");
-}
-private void toggleButtonElement_ToggleStateChanged(object sender, StateChangedEventArgs args)
-{
- RadMessageBox.Show("RadToggleButtonElement.ToggleState is changed to " + args.ToggleState.ToString());
-}
-private void buttonElement_Click(object sender, EventArgs e)
-{
- RadMessageBox.Show("RadButtonElement is clicked");
-}
-private void RadForm1_Load(object sender, EventArgs e)
-{
- AddDifferentItems();
-}
-
-````
-````VB.NET
-Private Sub AddDifferentItems()
- Me.RadButtonTextBox1.Multiline = True
- Dim buttonElement As RadButtonElement = New RadButtonElement()
- buttonElement.Text = "Button"
- AddHandler buttonElement.Click, AddressOf buttonElement_Click
- Me.RadButtonTextBox1.LeftButtonItems.Add(buttonElement)
- Dim toggleButtonElement As RadToggleButtonElement = New RadToggleButtonElement()
- toggleButtonElement.Text = "ToggleButton"
- AddHandler toggleButtonElement.ToggleStateChanged, AddressOf toggleButtonElement_ToggleStateChanged
- Me.RadButtonTextBox1.LeftButtonItems.Add(toggleButtonElement)
- Dim separator As CommandBarSeparator = New CommandBarSeparator()
- Me.RadButtonTextBox1.LeftButtonItems.Add(separator)
- Dim repeatButtonElement As RadRepeatButtonElement = New RadRepeatButtonElement()
- repeatButtonElement.Text = "RepeatButton"
- AddHandler repeatButtonElement.Click, AddressOf repeatButtonElement_Click
- Me.RadButtonTextBox1.LeftButtonItems.Add(repeatButtonElement)
- Dim checkBoxElement As RadCheckBoxElement = New RadCheckBoxElement()
- checkBoxElement.Text = "CheckBox"
- AddHandler checkBoxElement.CheckStateChanged, AddressOf checkBoxElement_CheckStateChanged
- Me.RadButtonTextBox1.RightButtonItems.Add(checkBoxElement)
-End Sub
-Private Sub checkBoxElement_CheckStateChanged(ByVal sender As Object, ByVal e As EventArgs)
- RadMessageBox.Show("RRadCheckBoxElement is toggled")
-End Sub
-Private Sub repeatButtonElement_Click(ByVal sender As Object, ByVal e As EventArgs)
- Console.WriteLine("RadRepeatButtonElement")
-End Sub
-Private Sub toggleButtonElement_ToggleStateChanged(ByVal sender As Object, ByVal args As StateChangedEventArgs)
- RadMessageBox.Show("RadToggleButtonElement.ToggleState is changed to " & args.ToggleState.ToString())
-End Sub
-Private Sub buttonElement_Click(ByVal sender As Object, ByVal e As EventArgs)
- RadMessageBox.Show("RadButtonElement is clicked")
-End Sub
-Private Sub RadForm1_Load(ByVal sender As Object, ByVal e As EventArgs)
- AddDifferentItems()
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
# See Also
diff --git a/controls/editors/calculatordropdown/customizing-appearance/accessing-and-customizing-elements.md b/controls/editors/calculatordropdown/customizing-appearance/accessing-and-customizing-elements.md
index b80f870bc..57fcde103 100644
--- a/controls/editors/calculatordropdown/customizing-appearance/accessing-and-customizing-elements.md
+++ b/controls/editors/calculatordropdown/customizing-appearance/accessing-and-customizing-elements.md
@@ -15,84 +15,40 @@ This topic will demonstrate how to access different element in the control in or
## Memory Element Visual Customization
-{{source=..\SamplesCS\Editors\RadCalculatorDropDownCustomization.cs region=ChangeTheImageOfMemoryElement}}
-{{source=..\SamplesVB\Editors\RadCalculatorDropDownCustomization.vb region=ChangeTheImageOfMemoryElement}}
+
+
-````C#
-this.radCalculatorDropDown1.CalculatorElement.MemoryElement.Image = Resources.email;
-````
-````VB.NET
-Me.RadCalculatorDropDown1.CalculatorElement.MemoryElement.Image = My.Resources.email
-
-````
-
-{{endregion}}
>caption Figure 1: RadCalculatorMemoryElement Customization

## Text Box Visual Customization
-{{source=..\SamplesCS\Editors\RadCalculatorDropDownCustomization.cs region=ChangeTheBackColorOfTheTextBox}}
-{{source=..\SamplesVB\Editors\RadCalculatorDropDownCustomization.vb region=ChangeTheBackColorOfTheTextBox}}
-
-````C#
-this.radCalculatorDropDown1.CalculatorElement.FillPrimitive.BackColor = Color.Yellow;
-this.radCalculatorDropDown1.CalculatorElement.EditorContentElement.Fill.BackColor = Color.Yellow;
-
-````
-````VB.NET
-Me.RadCalculatorDropDown1.CalculatorElement.FillPrimitive.BackColor = Color.Yellow
-Me.RadCalculatorDropDown1.CalculatorElement.EditorContentElement.Fill.BackColor = Color.Yellow
+
+
-````
-{{endregion}}
>caption Figure 2: Text Box Customization

## Calculator Visual Customization
-{{source=..\SamplesCS\Editors\RadCalculatorDropDownCustomization.cs region=ChangeTheBackColorOfTheCalculator}}
-{{source=..\SamplesVB\Editors\RadCalculatorDropDownCustomization.vb region=ChangeTheBackColorOfTheCalculator}}
+
+
-````C#
-this.radCalculatorDropDown1.CalculatorElement.CalculatorContentElement.BackColor = Color.Green;
-````
-````VB.NET
-Me.RadCalculatorDropDown1.CalculatorElement.CalculatorContentElement.BackColor = Color.Green
-
-````
-
-{{endregion}}
>caption Figure 3: Calculator Customization

## Buttons Visual Customization
-{{source=..\SamplesCS\Editors\RadCalculatorDropDownCustomization.cs region=ChangeTheBackColorOfButtons}}
-{{source=..\SamplesVB\Editors\RadCalculatorDropDownCustomization.vb region=ChangeTheBackColorOfButtons}}
-
-````C#
-this.radCalculatorDropDown1.CalculatorElement.CalculatorContentElement.ButtonEquals.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
-this.radCalculatorDropDown1.CalculatorElement.CalculatorContentElement.ButtonEquals.BackColor = Color.Navy;
-this.radCalculatorDropDown1.CalculatorElement.CalculatorContentElement.ButtonDelete.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
-this.radCalculatorDropDown1.CalculatorElement.CalculatorContentElement.ButtonDelete.BackColor = Color.Red;
-
-````
-````VB.NET
-Me.RadCalculatorDropDown1.CalculatorElement.CalculatorContentElement.ButtonEquals.GradientStyle = Telerik.WinControls.GradientStyles.Solid
-Me.RadCalculatorDropDown1.CalculatorElement.CalculatorContentElement.ButtonEquals.BackColor = Color.Navy
-Me.RadCalculatorDropDown1.CalculatorElement.CalculatorContentElement.ButtonDelete.GradientStyle = Telerik.WinControls.GradientStyles.Solid
-Me.RadCalculatorDropDown1.CalculatorElement.CalculatorContentElement.ButtonDelete.BackColor = Color.Red
+
+
-````
-{{endregion}}
>caption Figure 4: Button Elements Customization

diff --git a/controls/editors/calculatordropdown/getting-started.md b/controls/editors/calculatordropdown/getting-started.md
index f89427c32..4be399d34 100644
--- a/controls/editors/calculatordropdown/getting-started.md
+++ b/controls/editors/calculatordropdown/getting-started.md
@@ -42,23 +42,10 @@ The following example demonstrates how to set up __RadCalculatorDropDown__ with
2\. In the constructor of your form add the following code:
-{{source=..\SamplesCS\Editors\RadCalculatorDropDownGettingStarted.cs region=MinWidth}}
-{{source=..\SamplesVB\Editors\RadCalculatorDropDownGettingStarted.vb region=MinWidth}}
+
+
-````C#
-int desiredWidth = this.radCalculatorDropDown1.Width;
-this.radCalculatorDropDown1.CalculatorElement.MinPopupWidth = desiredWidth;
-this.radCalculatorDropDown1.CalculatorElement.MinPopupHeight = desiredWidth;
-````
-````VB.NET
-Dim desiredWidth As Integer = Me.RadCalculatorDropDown1.Width
-Me.RadCalculatorDropDown1.CalculatorElement.MinPopupWidth = desiredWidth
-Me.RadCalculatorDropDown1.CalculatorElement.MinPopupHeight = desiredWidth
-
-````
-
-{{endregion}}
3\. Press __F5__ to run the application. Click the arrow button to open the drop-down. Notice its size equaling that of the editor.
diff --git a/controls/editors/colorbox/getting-started.md b/controls/editors/colorbox/getting-started.md
index fc32f3ebb..0a2fb7ff7 100644
--- a/controls/editors/colorbox/getting-started.md
+++ b/controls/editors/colorbox/getting-started.md
@@ -44,28 +44,14 @@ The following example demonstrates how to change the __ForeColor__ of __RadLabe
2\. Select the __RadColorBox__, click the __Events tab__ of the __Property Window__, locate the __ValueChanged__ event and double-click it to create an event handler. Replace the event handler with the following code.
-{{source=..\SamplesCS\Editors\ColorBox1.cs region=colorBoxValueChanged}}
-{{source=..\SamplesVB\Editors\ColorBox1.vb region=colorBoxValueChanged}}
+
+
-````C#
-private void radColorBox1_ValueChanged(object sender, EventArgs e)
-{
- this.radLabel1.ForeColor = this.radColorBox1.Value;
-}
-````
-````VB.NET
-Private Sub RadColorBox1_ValueChanged(sender As Object, e As EventArgs)
- Me.RadLabel1.ForeColor = Me.RadColorBox1.Value
-End Sub
-````
-
-{{endregion}}
-
3\. Press __F5__ to run the application. Press the color dialog button and select a color. The color is then applied as __ForeColor__ of the __RadLabel__.
-#№ See Also
+## See Also
* [Design Time]({%slug winforms/editors/design-time%})
* [Structure]({%slug winforms/editors/structure%})
diff --git a/controls/editors/colorbox/properies-and-events.md b/controls/editors/colorbox/properies-and-events.md
index 9a68bd7d2..cd74f25c6 100644
--- a/controls/editors/colorbox/properies-and-events.md
+++ b/controls/editors/colorbox/properies-and-events.md
@@ -31,25 +31,11 @@ The __ValueChanging__ event fires before the value is changed and allows you to
#### Cancel ValueChanging.
-{{source=..\SamplesCS\Editors\ColorBox1.cs region=colorBoxValueChanging}}
-{{source=..\SamplesVB\Editors\ColorBox1.vb region=colorBoxValueChanging}}
-
-````C#
-private void radColorBox1_ValueChanging(object sender, Telerik.WinControls.UI.ValueChangingEventArgs e)
-{
- e.Cancel = !((Color)e.NewValue).IsNamedColor;
-}
-
-````
-````VB.NET
-Private Sub RadColorBox1_ValueChanging(sender As Object, e As Telerik.WinControls.UI.ValueChangingEventArgs)
- e.Cancel = Not DirectCast(e.NewValue, System.Drawing.Color).IsNamedColor
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
+
# See Also
* [Properties](https://docs.telerik.com/devtools/winforms/api/telerik.wincontrols.ui.radcolorbox.html#properties)
diff --git a/controls/editors/dateonlypicker/how-to/set-null-or-empty-value.md b/controls/editors/dateonlypicker/how-to/set-null-or-empty-value.md
index 90df413aa..7da12699b 100644
--- a/controls/editors/dateonlypicker/how-to/set-null-or-empty-value.md
+++ b/controls/editors/dateonlypicker/how-to/set-null-or-empty-value.md
@@ -14,57 +14,27 @@ __RadDateOnlyPicker__ has __NullableValue__ property which supports *null* value
#### Set to null
-{{source=..\SamplesCS\Editors\DateOnlyPicker.cs region=SetToNullValue}}
-{{source=..\SamplesVB\Editors\DateOnlyPicker.vb region=SetToNullValue}}
+
+
-````C#
-this.radDateOnlyPicker1.NullableValue = null;
-this.radDateOnlyPicker1.SetToNullValue();
-````
-````VB.NET
-Me.RadDateOnlyPicker1.NullableValue = Nothing
-Me.RadDateOnlyPicker1.SetToNullValue()
-````
-
-{{endregion}}
-
If you set the __NullText__ property, you can conditionally display a text based on the selected date. The null text will be displayed when the __NullableValue__ is null or when the __NullDate__ property value matches the current value.
#### Setting the NullText property of RadDateOnlyPicker
-{{source=..\SamplesCS\Editors\DateOnlyPicker.cs region=NullText}}
-{{source=..\SamplesVB\Editors\DateOnlyPicker.vb region=NullText}}
-
-````C#
-this.radDateOnlyPicker1.NullText = "No date selected";
+
+
-````
-````VB.NET
-Me.RadDateOnlyPicker1.NullText = "No date selected"
-````
-{{endregion}}
-
When the __NullDate__ property value is equal to the control value no text will be displayed in the text box part (if the __NullText__ is set it will appear). The default value of the property is __MinDate__, which is *1/1/1*. Below is the code snippet for setting __NullDate__ to a specific date (*01-01-2024*):
#### Setting the NullDate property of RadDateOnlyPicker
-{{source=..\SamplesCS\Editors\DateOnlyPicker.cs region=NullDate}}
-{{source=..\SamplesVB\Editors\DateOnlyPicker.vb region=NullDate}}
-
-````C#
-this.radDateOnlyPicker1.DateOnlyPickerElement.NullDate = new DateOnly(2024, 01, 01);
-
-````
-````VB.NET
-Me.RadDateOnlyPicker1.DateOnlyPickerElement.NullDate = New DateOnly(2024, 1, 1)
-
-````
+
+
-{{endregion}}
## See Also
diff --git a/controls/editors/dateonlypicker/properties-events.md b/controls/editors/dateonlypicker/properties-events.md
index 76fd7ca9e..0078e370a 100644
--- a/controls/editors/dateonlypicker/properties-events.md
+++ b/controls/editors/dateonlypicker/properties-events.md
@@ -16,132 +16,47 @@ The significant properties for __RadDateOnlyPicker__ are:
#### Setting the value of RadDateOnlyPicker
-{{source=..\SamplesCS\Editors\DateOnlyPicker.cs region=Value}}
-{{source=..\SamplesVB\Editors\DateOnlyPicker.vb region=Value}}
+
+
-````C#
-this.radDateOnlyPicker1.Value = new DateOnly(2024,1,1);
-````
-````VB.NET
-Me.RadDateOnlyPicker1.Value = New DateOnly(2024,1,1)
-````
-
-{{endregion}}
-
* __MinDate, MaxDate:__ These two __DateOnly__ type properties form the bounds that dates can be selected from in the picker. Attempts to select outside these bounds are ignored.
#### Setting the MinDate property of RadDateOnlyPicker
-{{source=..\SamplesCS\Editors\DateOnlyPicker.cs region=MinMaxDate}}
-{{source=..\SamplesVB\Editors\DateOnlyPicker.vb region=MinMaxDate}}
-
-````C#
-this.radDateOnlyPicker1.MinDate = new DateOnly(2024,10,1);
-this.radDateOnlyPicker1.MaxDate = new DateOnly(2024,10,31);
+
+
-````
-````VB.NET
-Me.RadDateOnlyPicker1.MinDate = New DateOnly(2024,10,1)
-Me.RadDateOnlyPicker1.MaxDate = New DateOnly(2024,10,31)
-````
-{{endregion}}
-
* __NullableValue__ is same as the __Value__ property, but the __NullableValue__ property is of type *Nullable DateOnly*. It can be *null* – in this case if **RadDateOnlyPicker** is not selected, it will show its __NullText__. In case **RadDateOnlyPicker** is selected, it will show the last entered date – this allows the end-user to enter and edit the date.
#### Setting the NullableValue property of RadDateOnlyPicker
-{{source=..\SamplesCS\Editors\DateOnlyPicker.cs region=NullableValue}}
-{{source=..\SamplesVB\Editors\DateOnlyPicker.vb region=NullableValue}}
-
-````C#
-this.radDateOnlyPicker1.NullableValue = null;
+
+
-````
-````VB.NET
-Me.RadDateOnlyPicker1.NullableValue = Nothing
-````
-{{endregion}}
-
__NullableValue__ can be bound to a business object that exposes a property of type nullable DateOnly. The code below demonstrates how to do this:
#### Bind the NullableValue to a business object.
-{{source=..\SamplesCS\Editors\DateOnlyPicker.cs region=NullableBinding}}
-{{source=..\SamplesVB\Editors\DateOnlyPicker.vb region=NullableBinding}}
-
-````C#
-public class MyObject
-{
- public MyObject(DateOnly? _endTime)
- {
- this._endTime = _endTime;
- }
- private DateOnly? _endTime;
- public DateOnly? EndTime
- {
- get { return _endTime; }
- set { _endTime = value; }
- }
-}
-
-protected override void OnLoad(EventArgs e)
-{
- base.OnLoad(e);
- MyObject myObject = new MyObject(DateOnly.FromDateTime(DateTime.Now.AddDays(1)));
- this.radDateOnlyPicker1.DataBindings.Add(new Binding("NullableValue", myObject, "EndTime", true, DataSourceUpdateMode.OnPropertyChanged));
-}
-
-````
-````VB.NET
-Public Class MyObject
- Public Sub New(ByVal _endTime? As DateOnly)
- Me._endTime = _endTime
- End Sub
- Private _endTime? As DateOnly
- Public Property EndTime() As DateOnly?
- Get
- Return _endTime
- End Get
- Set(ByVal value? As DateOnly)
- _endTime = value
- End Set
- End Property
-End Class
-
-Protected Overrides Sub OnLoad(ByVal e As EventArgs)
- MyBase.OnLoad(e)
- Dim myObject As MyObject = New MyObject(DateOnly.FromDateTime(DateTime.Now.AddDays(1)))
- Me.radDateOnlyPicker1.DataBindings.Add(New Binding("NullableValue", myObject, "EndTime", True, DataSourceUpdateMode.OnPropertyChanged))
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
+
* __NullText:__ This property defines the text that will be displayed in **RadDateOnlyPicker** when the __NullableValue__ property is set to *null* and **RadDateOnlyPicker** is not in focus. By default, __NullText__ is an empty string.
#### Setting the NullText property of RadDateOnlyPicker
-{{source=..\SamplesCS\Editors\DateOnlyPicker.cs region=NullText}}
-{{source=..\SamplesVB\Editors\DateOnlyPicker.vb region=NullText}}
+
+
-````C#
-this.radDateOnlyPicker1.NullText = "No date selected";
-````
-````VB.NET
-Me.RadDateOnlyPicker1.NullText = "No date selected"
-````
-
-{{endregion}}
-
* __TextBoxElement__: Gets an instance of RadTextBoxElement.
* __ArrowButton__: Gets an instance of RadArrowButtonElement.
diff --git a/controls/editors/datetimepicker/MaskDateTimeProvider.md b/controls/editors/datetimepicker/MaskDateTimeProvider.md
index 1a3c9c9b1..b000a5d5d 100644
--- a/controls/editors/datetimepicker/MaskDateTimeProvider.md
+++ b/controls/editors/datetimepicker/MaskDateTimeProvider.md
@@ -26,21 +26,10 @@ The MaskDateTimeProvider is responsible for the parsing of the dates. The MaskDa
The following code spinet demonstrates how one can access and use the provider:
-{{source=..\SamplesCS\Editors\DateTimePicker2.cs region=provider}}
-{{source=..\SamplesVB\Editors\DateTimePicker2.vb region=provider}}
+
+
-````C#
-MaskDateTimeProvider provider = this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider as MaskDateTimeProvider;
-provider.AutoSelectNextPart = true;
-````
-````VB.NET
-Dim provider As MaskDateTimeProvider = TryCast(Me.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider, MaskDateTimeProvider)
-provider.AutoSelectNextPart = True
-
-````
-
-{{endregion}}
>note
The __MaskProviderCreated__ event will be fired each time when new provider instance is created. For example when the MaskType is changed.
diff --git a/controls/editors/datetimepicker/customizing-appearance/customize-radcalendar-programmatically.md b/controls/editors/datetimepicker/customizing-appearance/customize-radcalendar-programmatically.md
index 83109e1b1..8742c8569 100644
--- a/controls/editors/datetimepicker/customizing-appearance/customize-radcalendar-programmatically.md
+++ b/controls/editors/datetimepicker/customizing-appearance/customize-radcalendar-programmatically.md
@@ -16,51 +16,10 @@ In order to customize __RadCalendar__ in __RadDateTimePicker__, you should first
#### Changing the font of RadCalendar navigation title
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=customizeRadCalendarProgramatically}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=customizeRadCalendarProgramatically}}
-
-````C#
-Font headerFont = new Font("Arial", 9.0f, FontStyle.Bold);
-Font datesFont = new Font("Arial", 9.0f, FontStyle.Italic);
-RadDateTimePickerCalendar calendarBehavior = this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar;
-RadCalendar calendar = calendarBehavior.Calendar as RadCalendar;
-RadCalendarElement calendarElement = calendar.CalendarElement as RadCalendarElement;
-calendarElement.CalendarNavigationElement.Font = headerFont;
-calendarElement.CalendarNavigationElement.ForeColor = Color.Yellow;
-calendarElement.CalendarNavigationElement.BackColor = Color.White;
-calendarElement.CalendarNavigationElement.BackColor2 = Color.Gray;
-calendarElement.CalendarNavigationElement.BackColor3 = Color.DarkGray;
-calendarElement.CalendarNavigationElement.BackColor4 = Color.Gainsboro;
-calendarElement.CalendarNavigationElement.BorderColor = Color.DarkGray;
-MonthViewElement monthView = calendarBehavior.Calendar.CalendarElement.CalendarVisualElement as MonthViewElement;
-foreach (RadItem item in monthView.TableElement.Children)
-{
- item.Font = datesFont;
-}
-
-````
-````VB.NET
-Dim headerFont As Font = New Font("Arial", 9.0F, FontStyle.Bold)
-Dim datesFont As Font = New Font("Arial", 9.0F, FontStyle.Italic)
-Dim calendarBehavior As RadDateTimePickerCalendar = TryCast(Me.RadDateTimePicker1.DateTimePickerElement.GetCurrentBehavior(), RadDateTimePickerCalendar)
-Dim calendar As RadCalendar = TryCast(calendarBehavior.Calendar, RadCalendar)
-Dim calendarElement As RadCalendarElement = TryCast(calendar.CalendarElement, RadCalendarElement)
-calendarElement.CalendarNavigationElement.Font = headerFont
-calendarElement.CalendarNavigationElement.ForeColor = Color.Yellow
-calendarElement.CalendarNavigationElement.BackColor = Color.White
-calendarElement.CalendarNavigationElement.BackColor2 = Color.Gray
-calendarElement.CalendarNavigationElement.BackColor3 = Color.DarkGray
-calendarElement.CalendarNavigationElement.BackColor4 = Color.Gainsboro
-calendarElement.CalendarNavigationElement.BorderColor = Color.DarkGray
-Dim monthView As MonthViewElement = TryCast(calendarBehavior.Calendar.CalendarElement.CalendarVisualElement, MonthViewElement)
-For Each item As RadItem In monthView.TableElement.Children
- item.Font = datesFont
-Next item
-
-````
-
-{{endregion}}
-
+
+
+
+
>caption Figure 1: The result from the above code:
@@ -71,21 +30,10 @@ Next item
The Clear and Today buttons of the calendar are located in its footer. The footer of the calendar is hidden in the RadDateTimePicker control. To show it, we need to call the __GetCurrentBehavior__() method to gen an instance of the RadCalendar inside the RadDateTimePicker control.
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=showCalendarFooter}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=showCalendarFooter}}
-
-````C#
-RadDateTimePickerCalendar calendarBehavior = this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar;
-calendarBehavior.Calendar.ShowFooter = true;
-
-````
-````VB.NET
-Dim calendarBehavior As RadDateTimePickerCalendar = TryCast(Me.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior(), RadDateTimePickerCalendar)
-calendarBehavior.Calendar.ShowFooter = True
+
+
-````
-{{endregion}}

diff --git a/controls/editors/datetimepicker/free-form-date-time-parsing.md b/controls/editors/datetimepicker/free-form-date-time-parsing.md
index f2e408e8b..3824d9ed2 100644
--- a/controls/editors/datetimepicker/free-form-date-time-parsing.md
+++ b/controls/editors/datetimepicker/free-form-date-time-parsing.md
@@ -17,21 +17,11 @@ You can read more about this parsing logic [here]({%slug winforms/editors/masked
#### Setting the value of RadDateTimePicker
-{{source=..\SamplesCS\Editors\DateTimePicker2.cs region=FreeFormDateTimeDateTimePicker}}
-{{source=..\SamplesVB\Editors\DateTimePicker2.vb region=FreeFormDateTimeDateTimePicker}}
-
-````C#
-this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.MaskType = MaskType.FreeFormDateTime;
-
-````
-````VB.NET
-Me.radDateTimePicker1.DateTimePickerElement.TextBoxElement.MaskType = MaskType.FreeFormDateTime
-
-````
-
-{{endregion}}
-
-
+
+
+
+
+
# See Also
* [Design Time]({%slug winforms/editors/datetimepicker/designtime%})
diff --git a/controls/editors/datetimepicker/how-to/set-null-or-empty-value.md b/controls/editors/datetimepicker/how-to/set-null-or-empty-value.md
index 6d8ad748d..c84db3319 100644
--- a/controls/editors/datetimepicker/how-to/set-null-or-empty-value.md
+++ b/controls/editors/datetimepicker/how-to/set-null-or-empty-value.md
@@ -15,57 +15,27 @@ __RadDateTimePicker__ now has __NullableValue__ property which supports *null* v
#### Set to null
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=SetToNullValue}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=SetToNullValue}}
+
+
-````C#
-this.radDateTimePicker1.NullableValue = null;
-this.radDateTimePicker1.SetToNullValue();
-````
-````VB.NET
-Me.RadDateTimePicker1.NullableValue = Nothing
-Me.RadDateTimePicker1.DateTimePickerElement.SetToNullValue()
-````
-
-{{endregion}}
-
If you set the __NullText__ property, you can conditionally display a text based on the selected date. The null text will be displayed when the __NullableValue__ is null or when the __NullDate__ property value matches the current value.
#### Setting the NullText property of RadDateTimePicker
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=NullText}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=NullText}}
-
-````C#
-this.radDateTimePicker1.NullText = "No date selected";
+
+
-````
-````VB.NET
-Me.RadDateTimePicker1.NullText = "No date selected"
-````
-{{endregion}}
-
When the __NullDate__ property value is equal to the control value no text will be displayed in the text box part (if the __NullText__ is set it will appear). The default value of the property is __MinDate__, which is *1/1/1900*. Below is the code snippet for setting __NullDate__ to a specific date (*01-01-2000*):
#### Setting the NullDate property of RadDateTimePicker
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=NullDate}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=NullDate}}
-
-````C#
-this.radDateTimePicker1.DateTimePickerElement.NullDate = new DateTime(2000, 01, 01);
-
-````
-````VB.NET
-Me.RadDateTimePicker1.DateTimePickerElement.NullDate = New DateTime(2000, 1, 1)
-
-````
+
+
-{{endregion}}
# See Also
diff --git a/controls/editors/datetimepicker/how-to/tweak-increment-step.md b/controls/editors/datetimepicker/how-to/tweak-increment-step.md
index 4347eefca..4ec35264a 100644
--- a/controls/editors/datetimepicker/how-to/tweak-increment-step.md
+++ b/controls/editors/datetimepicker/how-to/tweak-increment-step.md
@@ -19,118 +19,27 @@ When the user clicks the up/down arrow buttons or presses the arrow keys, the __
As a prerequisite for the example, __RadDateTimePicker__ should of course show minutes and to demonstrate the full power of the example, we also may want to show up/down arrow buttons instead of a dropdown button. To these customizations, we need to add the following code:
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=prerequisite}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=prerequisite}}
+
+
-````C#
-this.radDateTimePicker1.CustomFormat = "hh:mm";
-this.radDateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
-this.radDateTimePicker1.ShowUpDown = true;
-````
-````VB.NET
-Me.RadDateTimePicker1.CustomFormat = "hh:mm"
-Me.RadDateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom
-Me.RadDateTimePicker1.ShowUpDown = True
-````
-
-{{endregion}}
-
Here is the approach divided into separate steps:
1\. In the form's `Load` event handler subscribe to the __ValueChanged__ event of RadDateTimePicker. Define a DateTime variable globally which holds the initial value:
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=initialization}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=initialization}}
+
+
-````C#
-DateTime initialDateTime;
-private void Form1_Load(object sender, EventArgs e)
-{
- initialDateTime = this.radDateTimePicker1.Value;
- this.radDateTimePicker1.ValueChanged += new EventHandler(radDateTimePicker1_ValueChanged);
-}
-````
-````VB.NET
-Private initialDateTime As Date
-Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
- initialDateTime = Me.RadDateTimePicker1.Value
- AddHandler RadDateTimePicker1.ValueChanged, AddressOf radDateTimePicker1_ValueChanged
-End Sub
-````
-
-{{endregion}}
-
2\. Here comes the ValueChanged handler implementation. In this part we are first checking whether the new value of RadDateTimePicker is bigger than the old one or not. Then, we are getting the MaskDateTimeProvider responsible for the navigation between the date/time parts - hours, minutes, etc. If the provider states that the currently selected time part is minutes, we, depending on the the direction in which we want to change the value, call the __Up/Down__ method four times, so that we can have a step of 5 minutes as a result. Please note that we are setting and resetting the boolean flag __suspendValueChanged__ so that we can safely call __Up/Down__ methods:
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=valueChanged}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=valueChanged}}
-
-````C#
-bool suspendValueChanged = false;
-void radDateTimePicker1_ValueChanged(object sender, EventArgs e)
-{
- DateTime dt = this.radDateTimePicker1.Value;
- TimeSpan sp = dt - initialDateTime;
- if (!suspendValueChanged)
- {
- MaskDateTimeProvider provider = (this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider as MaskDateTimeProvider);
- if (provider.List[provider.SelectedItemIndex].type == PartTypes.Minutes)
- {
- suspendValueChanged = true;
- if (sp.Ticks < 0)
- {
- for (int i = 0; i < 4; ++i)
- {
- this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Down();
- }
- }
- if (sp.Ticks > 0)
- {
- for (int i = 0; i < 4; ++i)
- {
- this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Up();
- }
- }
- initialDateTime = this.radDateTimePicker1.Value;
- suspendValueChanged = false;
- }
- }
-}
-
-````
-````VB.NET
-Private suspendValueChanged As Boolean = False
-Private Sub radDateTimePicker1_ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
- Dim dt As Date = Me.RadDateTimePicker1.Value
- Dim sp As TimeSpan = dt.Subtract(initialDateTime)
- If Not suspendValueChanged Then
- Dim provider As MaskDateTimeProvider = (TryCast(Me.RadDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider, MaskDateTimeProvider))
- If provider.List(provider.SelectedItemIndex).type = PartTypes.Minutes Then
- suspendValueChanged = True
- If sp.Ticks < 0 Then
- For i As Integer = 0 To 3
- Me.RadDateTimePicker1.DateTimePickerElement.TextBoxElement.Down()
- Next i
- End If
- If sp.Ticks > 0 Then
- For i As Integer = 0 To 3
- Me.RadDateTimePicker1.DateTimePickerElement.TextBoxElement.Up()
- Next i
- End If
- initialDateTime = Me.RadDateTimePicker1.Value
- suspendValueChanged = False
- End If
- End If
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
+
The result is shown below. Just with a single click of the up arrow key, we increase the value of the minutes by 5:

diff --git a/controls/editors/datetimepicker/internationalization/cultureinfo-and-regioninfo-basics.md b/controls/editors/datetimepicker/internationalization/cultureinfo-and-regioninfo-basics.md
index 882522d6b..a88df88f9 100644
--- a/controls/editors/datetimepicker/internationalization/cultureinfo-and-regioninfo-basics.md
+++ b/controls/editors/datetimepicker/internationalization/cultureinfo-and-regioninfo-basics.md
@@ -40,19 +40,10 @@ The table below is a sample list of the names and identifiers found in the Cult

-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=SetPashtoCulture}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=SetPashtoCulture}}
+
+
-````C#
-this.radDateTimePicker1.Culture = new System.Globalization.CultureInfo("ps-AF");
-````
-````VB.NET
-Me.RadDateTimePicker1.Culture = New System.Globalization.CultureInfo("ps-AF")
-
-````
-
-{{endregion}}
>note There is a known issue in the .NET Framework considering the "fa-IR" culture. Please refer to the following MSDN resource for a solution:
>
diff --git a/controls/editors/datetimepicker/internationalization/date-formats.md b/controls/editors/datetimepicker/internationalization/date-formats.md
index 19002567a..770882d90 100644
--- a/controls/editors/datetimepicker/internationalization/date-formats.md
+++ b/controls/editors/datetimepicker/internationalization/date-formats.md
@@ -59,21 +59,10 @@ The table below shows a list of patterns that can be combined to create custo
>note It is possible to define your own format and set the RadDateTimePicker.**Format** property to **Custom** . Then, specify the desired **CustomFormat**, e.g. "**dd/MM/yyyy**".
-{{source=..\SamplesCS\Editors\DateTimePicker2.cs region=customFormat}}
-{{source=..\SamplesVB\Editors\DateTimePicker2.vb region=customFormat}}
+
+
-````C#
-this.radDateTimePicker1.Format = DateTimePickerFormat.Custom;
-this.radDateTimePicker1.CustomFormat = "yyyy/MM/dd";
-````
-````VB.NET
-Me.radDateTimePicker1.Format = DateTimePickerFormat.Custom
-Me.radDateTimePicker1.CustomFormat = "yyyy/MM/dd"
-
-````
-
-{{endregion}}
# See Also
diff --git a/controls/editors/datetimepicker/internationalization/internationalization.md b/controls/editors/datetimepicker/internationalization/internationalization.md
index 4549c6a4c..027c47661 100644
--- a/controls/editors/datetimepicker/internationalization/internationalization.md
+++ b/controls/editors/datetimepicker/internationalization/internationalization.md
@@ -15,19 +15,10 @@ RadCalendar provides built in internationalization support to build world-ready
\* The __Culture__ property can be set using the drop down list in the Properties Window or set in code. The screenshot below shows the __Culture__ property set to "German(Germany)".
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=culture}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=culture}}
+
+
-````C#
-this.radDateTimePicker1.Culture = new System.Globalization.CultureInfo("de-DE");
-````
-````VB.NET
-Me.RadDateTimePicker1.Culture = New System.Globalization.CultureInfo("de-DE")
-
-````
-
-{{endregion}}
>caption Figure 1: The culture is changed to German.
@@ -38,38 +29,20 @@ Me.RadDateTimePicker1.Culture = New System.Globalization.CultureInfo("de-DE")
* Right-to-Left = No (default value)
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=rightNo}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=rightNo}}
-
-````C#
-this.radDateTimePicker1.RightToLeft = RightToLeft.No;
-
-````
-````VB.NET
-Me.RadDateTimePicker1.RightToLeft = RightToLeft.No
+
+
-````
-{{endregion}}
>caption Figure 2: The right to left support is turned off.

\* Right-to-Left = Yes
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=rightYes}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=rightYes}}
+
+
-````C#
-this.radDateTimePicker1.RightToLeft = RightToLeft.Yes;
-````
-````VB.NET
-Me.RadDateTimePicker1.RightToLeft = RightToLeft.Yes
-
-````
-
-{{endregion}}
>caption Figure 3: The right to left support is turned on.
@@ -77,21 +50,10 @@ Me.RadDateTimePicker1.RightToLeft = RightToLeft.Yes
\* [Date Format Pattern]({%slug winforms/editors/datetimepicker/internationalization/date-formats%}): The __Format__ property has valid values of __Short__, __Long__, __Time__ and __Custom__. The __Custom__enables the __CustomFormat__ property.
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=customFormat}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=customFormat}}
-
-````C#
-this.radDateTimePicker1.Format = DateTimePickerFormat.Custom;
-this.radDateTimePicker1.CustomFormat = "MMM - dd - yyyy";
-
-````
-````VB.NET
-Me.RadDateTimePicker1.Format = DateTimePickerFormat.Custom
-Me.RadDateTimePicker1.CustomFormat = "MMM - dd - yyyy"
+
+
-````
-{{endregion}}
>caption Figure 4: Using Custom Format
diff --git a/controls/editors/datetimepicker/navigation-modes.md b/controls/editors/datetimepicker/navigation-modes.md
index 3a172ae5d..a063de0db 100644
--- a/controls/editors/datetimepicker/navigation-modes.md
+++ b/controls/editors/datetimepicker/navigation-modes.md
@@ -20,19 +20,10 @@ The embedded __RadCalendar__ has `HeaderNavigationMode` property, which determin
#### Setting the value of RadDateTimePicker
-{{source=..\SamplesCS\Editors\DateTimePicker2.cs region=HeaderNavigationMode}}
-{{source=..\SamplesVB\Editors\DateTimePicker2.vb region=HeaderNavigationMode}}
+
+
-````C#
-this.radDateTimePicker1.DateTimePickerElement.Calendar.HeaderNavigationMode = HeaderNavigationMode.Zoom;
-````
-````VB.NET
-Me.radDateTimePicker1.DateTimePickerElement.Calendar.HeaderNavigationMode = HeaderNavigationMode.Zoom
-
-````
-
-{{endregion}}

diff --git a/controls/editors/datetimepicker/raddatetimepicker-properties.md b/controls/editors/datetimepicker/raddatetimepicker-properties.md
index 376b27a13..b5d608df8 100644
--- a/controls/editors/datetimepicker/raddatetimepicker-properties.md
+++ b/controls/editors/datetimepicker/raddatetimepicker-properties.md
@@ -17,72 +17,30 @@ The significant properties for __RadDateTimePicker__ are:
#### Setting the value of RadDateTimePicker
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=Value}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=Value}}
+
+
-````C#
-this.radDateTimePicker1.Value = DateTime.Today.AddDays(1);
-
-````
-````VB.NET
-Me.RadDateTimePicker1.Value = DateTime.Now.AddDays(1)
-
-````
-
-{{endregion}}
-
* __MinDate, MaxDate:__ These two dates form the bounds that dates can be selected from in the picker. Attempts to select outside these bounds are ignored. The example below sets the __MinDate__ property to be the first day of the current month.
#### Setting the MinDate property of RadDateTimePicker
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=MinDate}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=MinDate}}
-
-````C#
-this.radDateTimePicker1.MinDate = DateTime.Today.AddDays(-DateTime.Today.Day);
-
-````
-````VB.NET
-Me.RadDateTimePicker1.MinDate = DateTime.Today.AddDays(-DateTime.Today.Day)
-
-````
+
+
-{{endregion}}
-
* __NullText:__ This property defines the text that will be displayed in **RadDateTimePicker** when the __NullableValue__ property is set to *null* and **RadDateTimePicker** is not in focus. By default, __NullText__ is an empty string.
-#### Setting the NullText property of RadDateTimePicker
-
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=NullText}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=NullText}}
-
-````C#
-this.radDateTimePicker1.NullText = "No date selected";
-
-````
-````VB.NET
-Me.RadDateTimePicker1.NullText = "No date selected"
-
-````
-
-{{endregion}}
+#### Setting the NullText property of RadDateTimePicker
+
+* __ShowTimePicker:__ Gets or sets a value indicating whether the time picker is displayed alongside the calendar in the drop-down popup of __RadDateTimePicker__. The default value is *false*. When set to *true*, selecting a date in the calendar does not auto-close the popup, allowing the user to also select a time.
-* __ShowTimePicker:__ Gets or sets a value indicating whether the time picker is displayed alongside the calendar in the drop-down popup of __RadDateTimePicker__. The default value is *false*. When set to *true*, selecting a date in the calendar does not auto-close the popup, allowing the user to also select a time.
+
+
-{{source=..\SamplesCS\Editors\DateTimePicker2.cs region=ShowTimePicker1}}
-{{source=..\SamplesVB\Editors\DateTimePicker2.vb region=ShowTimePicker1}}
+* __ShowTimePicker:__ this property determines the display of __TimePicker__ in popup element of __RadDateTimePicker__.
-````C#
-this.radDateTimePicker1.DateTimePickerElement.ShowTimePicker = true;
+
+
-````
-````VB.NET
-Me.radDateTimePicker1.DateTimePickerElement.ShowTimePicker = True
-
-````
-
-{{endregion}}
-
* __Format:__ The __DateTimePickerFormat__ enumeration values are __Long__, __Short__, __Time__ and __Custom__. Set __Format__ to __Custom__ to enable the __CustomFormat__ property.
@@ -113,108 +71,24 @@ Me.radDateTimePicker1.DateTimePickerElement.CalendarSize = New Size(300, 300)
#### Setting the NullableValue property of RadDateTimePicker
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=NullableValue}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=NullableValue}}
-
-````C#
-this.radDateTimePicker1.NullableValue = null;
-
-````
-````VB.NET
-Me.RadDateTimePicker1.NullableValue = Nothing
-
-````
+
+
-{{endregion}}
-
__NullableValue__ can be bound to a business object that exposes a property of type nullable DateTime. The code below demonstrates how to do this:
#### Bind the NullableValue to a business object.
-{{source=..\SamplesCS\Editors\DateTimePicker1.cs region=NullableBinding}}
-{{source=..\SamplesVB\Editors\DateTimePicker1.vb region=NullableBinding}}
-
-````C#
-public class MyObject
-{
- public MyObject(DateTime? _endTime)
- {
- this._endTime = _endTime;
- }
- private DateTime? _endTime;
- public DateTime? EndTime
- {
- get { return _endTime; }
- set { _endTime = value; }
- }
-}
-private BindingList myList;
-protected override void OnLoad(EventArgs e)
-{
- base.OnLoad(e);
- myList = new BindingList();
- myList.Add(new MyObject(null));
- myList.Add(new MyObject(DateTime.Now));
- myList.RaiseListChangedEvents = true;
- this.radDateTimePicker1.DataBindings.Add(new Binding("NullableValue", this.myList, "EndTime", true, DataSourceUpdateMode.OnPropertyChanged));
-}
-
-````
-````VB.NET
-Public Class MyObject
- Public Sub New(ByVal _endTime? As Date)
- Me._endTime = _endTime
- End Sub
- Private _endTime? As Date
- Public Property EndTime() As Date?
- Get
- Return _endTime
- End Get
- Set(ByVal value? As Date)
- _endTime = value
- End Set
- End Property
-End Class
-Private myList As BindingList(Of MyObject)
-Protected Overrides Sub OnLoad(ByVal e As EventArgs)
- MyBase.OnLoad(e)
- myList = New BindingList(Of MyObject)()
- myList.Add(New MyObject(Nothing))
- myList.Add(New MyObject(Date.Now))
- myList.RaiseListChangedEvents = True
- Me.RadDateTimePicker1.DataBindings.Add(New Binding("NullableValue", Me.myList, "EndTime", True, DataSourceUpdateMode.OnPropertyChanged))
-End Sub
-
-````
+
+
-{{endregion}}
-
* __Editing Time in RadDateTimePicker__
To use **RadDateTimePicker** as date and time editor you need to enable the embedded __TimePicker__ and set the desired mask that shows the time parts.
#### Enable the time picker.
-{{source=..\SamplesCS\Editors\DateTimePicker2.cs region=ShowTimePicker2}}
-{{source=..\SamplesVB\Editors\DateTimePicker2.vb region=ShowTimePicker2}}
-
-````C#
-this.radDateTimePicker1.DateTimePickerElement.ShowTimePicker = true;
-this.radDateTimePicker1.Format = DateTimePickerFormat.Custom;
-this.radDateTimePicker1.CustomFormat = "MMM - dd - yyyy hh:mm tt";
-(this.radDateTimePicker1.DateTimePickerElement.CurrentBehavior as RadDateTimePickerCalendar).DropDownMinSize = new System.Drawing.Size(330, 250);
-
-````
-````VB.NET
-Me.radDateTimePicker1.DateTimePickerElement.ShowTimePicker = True
-Me.radDateTimePicker1.Format = DateTimePickerFormat.[Custom]
-Me.radDateTimePicker1.CustomFormat = "MMM - dd - yyyy hh:mm tt"
-TryCast(Me.radDateTimePicker1.DateTimePickerElement.CurrentBehavior, RadDateTimePickerCalendar).DropDownMinSize = New System.Drawing.Size(330, 250)
-
-````
-
-{{endregion}}
-
+
+
# See Also
diff --git a/controls/editors/domainupdown/customizing-appearance/accessing-and-customizing-elements.md b/controls/editors/domainupdown/customizing-appearance/accessing-and-customizing-elements.md
index fc71bfe55..0c4c1e734 100644
--- a/controls/editors/domainupdown/customizing-appearance/accessing-and-customizing-elements.md
+++ b/controls/editors/domainupdown/customizing-appearance/accessing-and-customizing-elements.md
@@ -48,9 +48,6 @@ You can customize the nested elements at run time as well:
Me.radDomainUpDown1.DomainUpDownElement.EditableElement.BorderGradientStyle = Telerik.WinControls.GradientStyles.Solid
````
-
-{{endregion}}
-
# See Also
* [Design Time]({%slug winforms/editors/domainupdown/design-time%})
diff --git a/controls/editors/domainupdown/getting-started.md b/controls/editors/domainupdown/getting-started.md
index c56cb8eee..e4f4b7c8d 100644
--- a/controls/editors/domainupdown/getting-started.md
+++ b/controls/editors/domainupdown/getting-started.md
@@ -87,9 +87,6 @@ End Sub
````
-
-{{endregion}}
-
This is it! Now the change in the selection of the **RadDomainUpDown** instance will be reflected on **RadStatusStrip**.
## See Also
diff --git a/controls/editors/domainupdown/populating-with-data/adding-items-programmatically.md b/controls/editors/domainupdown/populating-with-data/adding-items-programmatically.md
index 323a25966..abc8db287 100644
--- a/controls/editors/domainupdown/populating-with-data/adding-items-programmatically.md
+++ b/controls/editors/domainupdown/populating-with-data/adding-items-programmatically.md
@@ -50,9 +50,6 @@ position: 1
Me.radDomainUpDown1.Items.Add(itemGermany)
````
-
-{{endregion}}
-
# See Also
* [Populating with data at Design Time]({%slug winforms/editors/domainupdown/populating-with-data/design-time%})
diff --git a/controls/editors/domainupdown/populating-with-data/data-binding.md b/controls/editors/domainupdown/populating-with-data/data-binding.md
index c47f68abd..f2ebf873c 100644
--- a/controls/editors/domainupdown/populating-with-data/data-binding.md
+++ b/controls/editors/domainupdown/populating-with-data/data-binding.md
@@ -121,9 +121,6 @@ You can bind **RadDomainUpDown** programmatically as well. The following code sn
````
-
-{{endregion}}
-
>caption Figure: 4 RadDomainUpDown bound at Run time

diff --git a/controls/editors/maskededitbox/customizing-appearance/accessing-and-customizing-elements.md b/controls/editors/maskededitbox/customizing-appearance/accessing-and-customizing-elements.md
index e75c647b9..d8909b0f3 100644
--- a/controls/editors/maskededitbox/customizing-appearance/accessing-and-customizing-elements.md
+++ b/controls/editors/maskededitbox/customizing-appearance/accessing-and-customizing-elements.md
@@ -19,9 +19,6 @@ You can access and modify the style for different elements in __RadMaskedEditBox
>caption Figure 1: Element Hierarchy Editor

-
-{{endregion}}
-
# See Also
* [Element Hierarchy Editor]({%slug winforms/tools/element-hierarchy-editor%})
diff --git a/controls/editors/maskededitbox/date-and-time-masks.md b/controls/editors/maskededitbox/date-and-time-masks.md
index a1026ae4e..8e2702305 100644
--- a/controls/editors/maskededitbox/date-and-time-masks.md
+++ b/controls/editors/maskededitbox/date-and-time-masks.md
@@ -66,24 +66,11 @@ For example, a DateFormat of "ddd, MMMM yyyy - dd" might display:
## See Also
diff --git a/controls/editors/maskededitbox/localization.md b/controls/editors/maskededitbox/localization.md
index b1ba7e38f..3426d4671 100644
--- a/controls/editors/maskededitbox/localization.md
+++ b/controls/editors/maskededitbox/localization.md
@@ -20,66 +20,14 @@ To localize **RadMaskedEditBox** to display text and messages in a specific lang
Below is a sample implementation of an English localization provider:
-{{source=..\SamplesCS\Editors\MaskEditBox1.cs region=MyRadMaskedEditBoxLocalizationProvider}}
-{{source=..\SamplesVB\Editors\MaskEditBox1.vb region=MyRadMaskedEditBoxLocalizationProvider}}
+
+
-````C#
-public class MyRadMaskedEditBoxLocalizationProvider : RadMaskedEditBoxLocalizationProvider
-{
- public override string GetLocalizedString(string id)
- {
- switch (id)
- {
- case RadMaskedEditBoxStringId.CopyMenuItem: return "Copy";
- case RadMaskedEditBoxStringId.CutMenuItem: return "Cut";
- case RadMaskedEditBoxStringId.DeleteMenuItem: return "Delete";
- case RadMaskedEditBoxStringId.PasteMenuItem: return "Paste";
- case RadMaskedEditBoxStringId.SelectAllMenuItem: return "SelectAll";
- }
-
- return string.Empty;
- }
-}
-````
-````VB.NET
-Public Class MyRadMaskedEditBoxLocalizationProvider
- Inherits RadMaskedEditBoxLocalizationProvider
- Public Overrides Function GetLocalizedString(ByVal id As String) As String
- Select Case id
- Case RadMaskedEditBoxStringId.CopyMenuItem
- Return "Copy"
- Case RadMaskedEditBoxStringId.CutMenuItem
- Return "Cut"
- Case RadMaskedEditBoxStringId.DeleteMenuItem
- Return "Delete"
- Case RadMaskedEditBoxStringId.PasteMenuItem
- Return "Paste"
- Case RadMaskedEditBoxStringId.SelectAllMenuItem
- Return "SelectAll"
- End Select
-
- Return String.Empty
- End Function
-
-````
-
-{{endregion}}
To apply the custom localization provider, instantiate and assign it to the current localization provider:
#### Assigning the Current Localization Provider
-{{source=..\SamplesCS\Editors\MaskEditBox1.cs region=localizeMaskEditBox}}
-{{source=..\SamplesVB\Editors\MaskEditBox1.vb region=localizeMaskEditBox}}
-````C#
-RadMaskedEditBoxLocalizationProvider.CurrentProvider = new MyRadMaskedEditBoxLocalizationProvider();
-
-````
-````VB.NET
-RadMaskedEditBoxLocalizationProvider.CurrentProvider = New MyRadMaskedEditBoxLocalizationProvider()
-
-````
-
-{{endregion}}
-
+
+
\ No newline at end of file
diff --git a/controls/editors/maskededitbox/standard-masks.md b/controls/editors/maskededitbox/standard-masks.md
index 9dec18d6d..c11e66370 100644
--- a/controls/editors/maskededitbox/standard-masks.md
+++ b/controls/editors/maskededitbox/standard-masks.md
@@ -39,21 +39,10 @@ The table below describe the mask characters that can be used when the __MaskTyp
When the mask type is set to *Standard* you can access the **StandardMaskTextBoxProvider** by casting to that appropriate type.
-{{source=..\SamplesCS\Editors\MaskEditBox1.cs region=StandardProvider}}
-{{source=..\SamplesVB\Editors\MaskEditBox1.vb region=StandardProvider}}
+
+
-````C#
-this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Standard;
-StandardMaskTextBoxProvider provider = this.radMaskedEditBox1.MaskedEditBoxElement.Provider as StandardMaskTextBoxProvider;
-````
-````VB.NET
-Me.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Standard
-Dim provider As StandardMaskTextBoxProvider = TryCast(Me.radMaskedEditBox1.MaskedEditBoxElement.Provider, StandardMaskTextBoxProvider)
-
-````
-
-{{endregion}}
### Useful properties
diff --git a/controls/editors/maskededitbox/textmaskformat-property.md b/controls/editors/maskededitbox/textmaskformat-property.md
index bc95fe4c1..46ba6db3e 100644
--- a/controls/editors/maskededitbox/textmaskformat-property.md
+++ b/controls/editors/maskededitbox/textmaskformat-property.md
@@ -27,24 +27,10 @@ Let's now analyze how this property works in the context of several popular mask
1\. First, we need to define our mask:
-{{source=..\SamplesCS\Editors\MaskEditBox1.cs region=phoneMask}}
-{{source=..\SamplesVB\Editors\MaskEditBox1.vb region=phoneMask}}
+
+
-````C#
-
-this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Standard;
-this.radMaskedEditBox1.Mask = "(000) 000-0000";
-this.radMaskedEditBox1.PromptChar = '_';
-
-````
-````VB.NET
-Me.RadMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Standard
-Me.RadMaskedEditBox1.Mask = "(000) 000-0000"
-Me.RadMaskedEditBox1.PromptChar = "_"
-
-````
-{{endregion}}
2\. Then, let's assume that the user types "123123123". As you can notice, the number of digits is smaller than the provided prompt places by one and this is for demonstration purposes. The result in the UI of RadMaskedEditBox will look like this:
@@ -72,22 +58,10 @@ And here is what the __Value__ property of RadMaskedEditBox will return dependin
1\. Define the Current mask as show below:
-{{source=..\SamplesCS\Editors\MaskEditBox1.cs region=currencyMask}}
-{{source=..\SamplesVB\Editors\MaskEditBox1.vb region=currencyMask}}
-
-````C#
-
-this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric;
-this.radMaskedEditBox1.Mask = "C2";
-
-````
-````VB.NET
-Me.RadMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric
-Me.RadMaskedEditBox1.Mask = "C2"
+
+
-````
-{{endregion}}
2\. Now, assume that the user types "-1234.12". The UI of RadMaskedEditBox in this case look like this:
diff --git a/controls/editors/maskededitbox/timespan-masks.md b/controls/editors/maskededitbox/timespan-masks.md
index 37d461d97..26009e07b 100644
--- a/controls/editors/maskededitbox/timespan-masks.md
+++ b/controls/editors/maskededitbox/timespan-masks.md
@@ -65,9 +65,6 @@ When the mask type is set to *TimeSpan* you can access the **MaskTimeSpanProvide
provider.MillisecondsStep = 5
````
-
-{{endregion}}
-
## See Also
* [Standard]({%slug winforms/editors/maskededitbox/standard-masks%})
diff --git a/controls/editors/maskededitbox/working-with-radmaskededitbox.md b/controls/editors/maskededitbox/working-with-radmaskededitbox.md
index dcceeeeb9..dd24169ae 100644
--- a/controls/editors/maskededitbox/working-with-radmaskededitbox.md
+++ b/controls/editors/maskededitbox/working-with-radmaskededitbox.md
@@ -47,24 +47,10 @@ __RadMaskedEditBox__ descends from RadTextBox and so has the same properties, me

-{{source=..\SamplesCS\Editors\MaskEditBox1.cs region=workingWithRadMaskedEditBox}}
-{{source=..\SamplesVB\Editors\MaskEditBox1.vb region=workingWithRadMaskedEditBox}}
+
+
-````C#
-
-this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.DateTime;
-this.radMaskedEditBox1.Mask = "d";
-this.radMaskedEditBox1.Culture = new System.Globalization.CultureInfo("de-de");
-````
-````VB.NET
-Me.RadMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.DateTime
-Me.RadMaskedEditBox1.Mask = "D"
-Me.RadMaskedEditBox1.Culture = New System.Globalization.CultureInfo("de-DE")
-
-````
-
-{{endregion}}
* __Value:__ This property returns user input without the formatting characters. If you want the input and the formatting characters, use the __Text__ property.
diff --git a/controls/editors/popupeditor/customize-elements.md b/controls/editors/popupeditor/customize-elements.md
index 2a148f334..0c93e33d6 100644
--- a/controls/editors/popupeditor/customize-elements.md
+++ b/controls/editors/popupeditor/customize-elements.md
@@ -17,22 +17,10 @@ You can access the text box by using the __TextBoxElement__ property. This allow
#### Customize TextBoxElement
-{{source=..\SamplesCS\Editors\PopupEditor\PopupEditorCode.cs region=TextBox}}
-{{source=..\SamplesVB\Editors\PopupEditor\PopupEditorCode.vb region=TextBox}}
+
+
-````C#
-radPopupEditor1.TextBoxElement.Font = new Font("Arial", 12, FontStyle.Regular);
-radPopupEditor1.ForeColor = ColorTranslator.FromHtml("#008de7");
-````
-````VB.NET
-radPopupEditor1.TextBoxElement.Font = New Font("Arial", 12, FontStyle.Regular)
-radPopupEditor1.ForeColor = ColorTranslator.FromHtml("#008de7")
-
-````
-
-{{endregion}}
-
>caption Figure 1: Customizing the text box Font and ForeColor.
@@ -45,21 +33,8 @@ The arrow button can be accessed via the __ArrowButtonElement__ property. The fo
#### Set arrow button BackColor
-{{source=..\SamplesCS\Editors\PopupEditor\PopupEditorCode.cs region=Button}}
-{{source=..\SamplesVB\Editors\PopupEditor\PopupEditorCode.vb region=Button}}
-
-````C#
-radPopupEditor1.PopupEditorElement.ArrowButtonElement.Fill.BackColor = ColorTranslator.FromHtml("#009de1");
-radPopupEditor1.PopupEditorElement.ArrowButtonElement.Fill.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
-
-````
-````VB.NET
-radPopupEditor1.PopupEditorElement.ArrowButtonElement.Fill.BackColor = ColorTranslator.FromHtml("#009de1")
-radPopupEditor1.PopupEditorElement.ArrowButtonElement.Fill.GradientStyle = Telerik.WinControls.GradientStyles.Solid
-
-````
-
-{{endregion}}
+
+
@@ -73,25 +48,10 @@ The popup can be access with the __Popup__ property. This gives you access to al
#### Change Popup BackColor
-{{source=..\SamplesCS\Editors\PopupEditor\PopupEditorCode.cs region=DropDown}}
-{{source=..\SamplesVB\Editors\PopupEditor\PopupEditorCode.vb region=DropDown}}
-
-````C#
-void RadForm1_Load(object sender, EventArgs e)
-{
- radPopupEditor1.Popup.BackColor = ColorTranslator.FromHtml("#009de1");
-}
-
-````
-````VB.NET
-Private Sub RadForm1_Load(ByVal sender As Object, ByVal e As EventArgs)
- radPopupEditor1.Popup.BackColor = ColorTranslator.FromHtml("#009de1")
-End Sub
+
+
-````
-{{endregion}}
-
>caption Figure 3: Change Popup BackColor.
diff --git a/controls/editors/popupeditor/getting-started.md b/controls/editors/popupeditor/getting-started.md
index b28825738..d8f1963c6 100644
--- a/controls/editors/popupeditor/getting-started.md
+++ b/controls/editors/popupeditor/getting-started.md
@@ -50,41 +50,10 @@ Add __Click__ event handlers for the both buttons and then use the following cod
#### Buttons event handlers
-{{source=..\SamplesCS\Editors\PopupEditor\PopupEditorCode.cs region=EventHandlers}}
-{{source=..\SamplesVB\Editors\PopupEditor\PopupEditorCode.vb region=EventHandlers}}
-
-````C#
-private void radButton1_Click(object sender, EventArgs e)
-{
- this.radPopupEditor1.Text = radTextBox1.Text + " " + radTextBox2.Text;
- radPopupEditor1.PopupEditorElement.ClosePopup();
-}
-private void radButton2_Click(object sender, EventArgs e)
-{
- this.radPopupEditor1.Text = "";
- radTextBox1.Text = "";
- radTextBox2.Text = "";
- radTextBox3.Text = "";
- radPopupEditor1.PopupEditorElement.ClosePopup();
-}
-
-````
-````VB.NET
-Private Sub radButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
- Me.radPopupEditor1.Text = radTextBox1.Text & " " & radTextBox2.Text
- radPopupEditor1.PopupEditorElement.ClosePopup()
-End Sub
-Private Sub radButton2_Click(ByVal sender As Object, ByVal e As EventArgs)
- Me.radPopupEditor1.Text = ""
- radTextBox1.Text = ""
- radTextBox2.Text = ""
- radTextBox3.Text = ""
- radPopupEditor1.PopupEditorElement.ClosePopup()
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
This way when __Submit__ is pressed the name will be displayed in the control's text box.
diff --git a/controls/editors/popupeditor/handling-popup-keyboard-input.md b/controls/editors/popupeditor/handling-popup-keyboard-input.md
index 4783f50bc..47e5ba0b7 100644
--- a/controls/editors/popupeditor/handling-popup-keyboard-input.md
+++ b/controls/editors/popupeditor/handling-popup-keyboard-input.md
@@ -16,29 +16,10 @@ As of **R1 2021** the RadPopupEditor.**Popup** offers keyboard handling via its
#### Handling Escape
-{{source=..\SamplesCS\Editors\PopupEditor\PopupEditorCode.cs region=HandleEscape}}
-{{source=..\SamplesVB\Editors\PopupEditor\PopupEditorCode.vb region=HandleEscape}}
-
-````C#
- private void Popup_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyData== Keys.Escape)
- {
- e.Handled = true;
- }
- }
-
-````
-````VB.NET
- Private Sub Popup_KeyDown(sender As Object, e As KeyEventArgs)
- If e.KeyData = Keys.Escape Then
- e.Handled = True
- End If
- End Sub
-
-````
-
-{{endregion}}
+
+
+
+
The **KeyEventArgs** exposes the following useful information:
diff --git a/controls/editors/popupeditor/properties-events-and-methods.md b/controls/editors/popupeditor/properties-events-and-methods.md
index fa75a66bf..f3620bf18 100644
--- a/controls/editors/popupeditor/properties-events-and-methods.md
+++ b/controls/editors/popupeditor/properties-events-and-methods.md
@@ -81,39 +81,20 @@ This article describes the most commonly used properties, events and methods.
#### Close Popup
-{{source=..\SamplesCS\Editors\PopupEditor\PopupEditorCode.cs region=close}}
-{{source=..\SamplesVB\Editors\PopupEditor\PopupEditorCode.vb region=close}}
+
+
-````C#
-radPopupEditor1.PopupEditorElement.ClosePopup(RadPopupCloseReason.CloseCalled);
-````
-````VB.NET
-radPopupEditor1.PopupEditorElement.ClosePopup(RadPopupCloseReason.CloseCalled)
-````
-
-{{endregion}}
-
* __ShowPopup:__ This method can be used for programmatically showing the popup.
#### Show Popup
-{{source=..\SamplesCS\Editors\PopupEditor\PopupEditorCode.cs region=show}}
-{{source=..\SamplesVB\Editors\PopupEditor\PopupEditorCode.vb region=show}}
-
-````C#
-radPopupEditor1.PopupEditorElement.ShowPopup();
-
-````
-````VB.NET
-radPopupEditor1.PopupEditorElement.ShowPopup()
+
+
-````
-{{endregion}}
-
# See Also
diff --git a/controls/editors/spineditor/getting-started.md b/controls/editors/spineditor/getting-started.md
index 959283fd2..5173ffe0a 100644
--- a/controls/editors/spineditor/getting-started.md
+++ b/controls/editors/spineditor/getting-started.md
@@ -44,25 +44,11 @@ The following tutorial demonstrates changing the thumb position on a __RadTrackB
3\. Click the `Events` tab of the Property Window, locate the __ValueChanged__ event and double-click it to create an event handler. Replace the event handler with the following code.
-{{source=..\SamplesCS\Editors\SpinEditor1.cs region=spinEditorAndTrackBar}}
-{{source=..\SamplesVB\Editors\SpinEditor1.vb region=spinEditorAndTrackBar}}
+
+
-````C#
-void radSpinEditor1_ValueChanged(object sender, EventArgs e)
-{
- this.radTrackBar1.Value = Convert.ToInt32(radSpinEditor1.Value);
-}
-````
-````VB.NET
-Private Sub RadSpinEditor1_ValueChanged1(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadSpinEditor1.ValueChanged
- Me.RadTrackBar1.Value = Convert.ToInt32(RadSpinEditor1.Value)
-End Sub
-````
-
-{{endregion}}
-
4\. Press __F5__ to run the application. Experiment with the
behavior of the RadSpinEditor by typing values directly to the editor,
by clicking the up and down arrows, and by pressing the up and down arrow
diff --git a/controls/editors/spineditor/null-value-support.md b/controls/editors/spineditor/null-value-support.md
index f1fb02a75..cffee238d 100644
--- a/controls/editors/spineditor/null-value-support.md
+++ b/controls/editors/spineditor/null-value-support.md
@@ -18,111 +18,10 @@ You can find below a sample code snippet demonstrating how to use the **Nullable
#### Simple data binding with null value
-{{source=..\SamplesCS\Editors\SpinEditor1.cs region=NullableValue}}
-{{source=..\SamplesVB\Editors\SpinEditor1.vb region=NullableValue}}
+
+
-````C#
-public void InitializeNullableSpinEditor()
-{
-
- this.radSpinEditor1.EnableNullValueInput = true;
- this.radSpinEditor1.NullableValueChanged += radSpinEditor1_NullableValueChanged;
- Item item = new Item("Apple", 2);
- this.radSpinEditor1.DataBindings.Add("NullableValue", item, "Id", true, DataSourceUpdateMode.OnPropertyChanged);
-}
-private void radSpinEditor1_NullableValueChanged(object sender, EventArgs e)
-{
- RadMessageBox.Show("NullableValue is changed "+ this.radSpinEditor1.NullableValue);
-}
-public class Item : System.ComponentModel.INotifyPropertyChanged
-{
- private string _name;
- private int? _id;
- public Item(string name, int? id)
- {
- this._name = name;
- this._id = id;
- }
- public string Name
- {
- get
- {
- return this._name;
- }
- set
- {
- this._name = value;
- OnPropertyChanged("Name");
- }
- }
- public int? Id
- {
- get
- {
- return this._id;
- }
- set
- {
- this._id = value;
- OnPropertyChanged("Id");
- }
- }
- public event PropertyChangedEventHandler PropertyChanged;
- protected virtual void OnPropertyChanged(string propertyName)
- {
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
-}
-````
-````VB.NET
-Public Sub InitializeNullableSpinEditor()
- Me.RadSpinEditor1.EnableNullValueInput = True
- AddHandler Me.RadSpinEditor1.NullableValueChanged, AddressOf radSpinEditor1_NullableValueChanged
- Dim item As New Item("Apple", 2)
- Me.RadSpinEditor1.DataBindings.Add("NullableValue", item, "Id", True, Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)
-End Sub
-Private Sub radSpinEditor1_NullableValueChanged(sender As Object, e As EventArgs)
- RadMessageBox.Show("NullableValue is changed " & Me.RadSpinEditor1.NullableValue)
-End Sub
-Public Class Item
- Implements System.ComponentModel.INotifyPropertyChanged
- Private _name As String
- Private _id As System.Nullable(Of Integer)
- Public Sub New(name As String, id As System.Nullable(Of Integer))
- Me._name = name
- Me._id = id
- End Sub
- Public Property Name() As String
- Get
- Return Me._name
- End Get
- Set(value As String)
- Me._name = value
- OnPropertyChanged("Name")
- End Set
- End Property
- Public Property Id() As System.Nullable(Of Integer)
- Get
- Return Me._id
- End Get
- Set(value As System.Nullable(Of Integer))
- Me._id = value
- OnPropertyChanged("Id")
- End Set
- End Property
- Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
- Protected Overridable Sub OnPropertyChanged(ByVal propertyName As String)
- RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
- End Sub
-End Class
-
-````
-
-{{endregion}}
# See Also
diff --git a/controls/editors/textbox/adding-buttons-to-radtextbox.md b/controls/editors/textbox/adding-buttons-to-radtextbox.md
index 3412a274c..b1e32dd9c 100644
--- a/controls/editors/textbox/adding-buttons-to-radtextbox.md
+++ b/controls/editors/textbox/adding-buttons-to-radtextbox.md
@@ -25,59 +25,9 @@ In this particular case we are going to add three buttons to RadTextBox:
1\. First, let's create three buttons. In order to arrange them in stacked formation, we need to add them to a [StackLayoutPanel]({%slug winforms/telerik-presentation-framework/layout/predefined-layout-panels%}):
-{{source=..\SamplesCS\Editors\TextBoxWithButtons.cs region=creatingButtons}}
-{{source=..\SamplesVB\Editors\TextBoxWithButtons.vb region=creatingButtons}}
-
-````C#
-RadButtonElement button = new RadButtonElement();
-button.Click += new EventHandler(button_Click);
-button.Padding = new Padding(2, 0, 2, -2);
-button.Margin = new Padding(0, 0, 0, 0);
-button.Text = "...";
-RadButtonElement button2 = new RadButtonElement();
-button2.Click += new EventHandler(button_Click);
-button2.Padding = new Padding(2, 0, 2, -2);
-button2.Margin = new Padding(1, 0, 2, 0);
-button2.Text = "///";
-RadButtonElement button3 = new RadButtonElement();
-button3.Click += new EventHandler(button_Click);
-button3.Padding = new Padding(2, 0, 2, -2);
-button3.Margin = new Padding(1, 0, 1, 0);
-button3.Text = @"\\\";
-StackLayoutElement stackPanel = new StackLayoutElement();
-stackPanel.Orientation = Orientation.Horizontal;
-stackPanel.Margin = new Padding(1, 0, 1, 0);
-stackPanel.Children.Add(button);
-stackPanel.Children.Add(button2);
-stackPanel.Children.Add(button3);
-
-````
-````VB.NET
-Dim button As New RadButtonElement()
-AddHandler button.Click, AddressOf button_Click
-button.Padding = New Padding(2, 0, 2, -2)
-button.Margin = New Padding(0, 0, 0, 0)
-button.Text = "..."
-Dim button2 As New RadButtonElement()
-AddHandler button2.Click, AddressOf button_Click
-button2.Padding = New Padding(2, 0, 2, -2)
-button2.Margin = New Padding(1, 0, 2, 0)
-button2.Text = "///"
-Dim button3 As New RadButtonElement()
-AddHandler button3.Click, AddressOf button_Click
-button3.Padding = New Padding(2, 0, 2, -2)
-button3.Margin = New Padding(1, 0, 1, 0)
-button3.Text = "\\\"
-Dim stackPanel As New StackLayoutElement()
-stackPanel.Orientation = Orientation.Horizontal
-stackPanel.Margin = New Padding(1, 0, 1, 0)
-stackPanel.Children.Add(button)
-stackPanel.Children.Add(button2)
-stackPanel.Children.Add(button3)
-
-````
-
-{{endregion}}
+
+
+
As you can see, we are also setting the __Padding__ of the buttons. This allows us to set some size to these buttons bigger than the default one. In addition, we are setting the __Margin__ of the buttons, so that there is some space between them.
@@ -85,76 +35,25 @@ As you can see, we are also setting the __Padding__ of the buttons. This allows
2\. Now we should place the __StackLayoutPanel__ in RadTextBox. In order to achieve the proper layout between the textbox part and the buttons, we need to put the item responsible for the textbox part and the __StackLayoutPanel__ in a __DockLayoutPanel__:
-{{source=..\SamplesCS\Editors\TextBoxWithButtons.cs region=dockLayoutPanel}}
-{{source=..\SamplesVB\Editors\TextBoxWithButtons.vb region=dockLayoutPanel}}
-
-````C#
-RadTextBoxItem tbItem = this.radTextBox1.TextBoxElement.TextBoxItem;
-this.radTextBox1.TextBoxElement.Children.Remove(tbItem);
-DockLayoutPanel dockPanel = new DockLayoutPanel();
-dockPanel.Children.Add(stackPanel);
-dockPanel.Children.Add(tbItem);
-DockLayoutPanel.SetDock(tbItem, Telerik.WinControls.Layouts.Dock.Left);
-DockLayoutPanel.SetDock(stackPanel, Telerik.WinControls.Layouts.Dock.Right);
-this.radTextBox1.TextBoxElement.Children.Add(dockPanel);
-
-````
-````VB.NET
-Dim tbItem As RadTextBoxItem = Me.RadTextBox1.TextBoxElement.TextBoxItem
-Me.RadTextBox1.TextBoxElement.Children.Remove(tbItem)
-Dim dockPanel As New DockLayoutPanel()
-dockPanel.Children.Add(stackPanel)
-dockPanel.Children.Add(tbItem)
-DockLayoutPanel.SetDock(tbItem, Telerik.WinControls.Layouts.Dock.Left)
-DockLayoutPanel.SetDock(stackPanel, Telerik.WinControls.Layouts.Dock.Right)
-Me.RadTextBox1.TextBoxElement.Children.Add(dockPanel)
-
-````
-
-{{endregion}}
-
+
+
+
-3\. We are setting some __Margin__ and __Padding__ properties to the elements of RadTextBox which centers the buttons and the text vertically:
-{{source=..\SamplesCS\Editors\TextBoxWithButtons.cs region=finalPadding}}
-{{source=..\SamplesVB\Editors\TextBoxWithButtons.vb region=finalPadding}}
+3\. We are setting some __Margin__ and __Padding__ properties to the elements of RadTextBox which centers the buttons and the text vertically:
-````C#
-this.radTextBox1.TextBoxElement.Padding = new Padding(1, 1, 1, 1);
-tbItem.Margin = new Padding(0, 1, 0, 0);
+
+
-````
-````VB.NET
-Me.RadTextBox1.TextBoxElement.Padding = New Padding(1, 1, 1, 1)
-tbItem.Margin = New Padding(0, 1, 0, 0)
-````
-{{endregion}}
-
4\. To complete the scenario, here is the event handler implementation for the Click event:
-{{source=..\SamplesCS\Editors\TextBoxWithButtons.cs region=clickHandler}}
-{{source=..\SamplesVB\Editors\TextBoxWithButtons.vb region=clickHandler}}
+
+
-````C#
-void button_Click(object sender, EventArgs e)
-{
- RadButtonElement button = sender as RadButtonElement;
- RadMessageBox.Show("Clicked! " + button.Text);
-}
-````
-````VB.NET
-Private Sub button_Click(ByVal sender As Object, ByVal e As EventArgs)
- Dim button As RadButtonElement = TryCast(sender, RadButtonElement)
- RadMessageBox.Show("Clicked! " & button.Text)
-End Sub
-````
-
-{{endregion}}
-
This is it! Now you have a good-looking RadTextBox with buttons!
# See Also
diff --git a/controls/editors/textbox/getting-started.md b/controls/editors/textbox/getting-started.md
index ff6769420..cd586ee2c 100644
--- a/controls/editors/textbox/getting-started.md
+++ b/controls/editors/textbox/getting-started.md
@@ -57,11 +57,6 @@ Dim myNewRadTextBox As New RadTextBox()
Me.Controls.Add(myNewRadTextBox)
````
-
-{{endregion}}
-
-
-
## Telerik UI for WinForms Learning Resources
* [Getting Started with Telerik UI for WinForms Components](https://docs.telerik.com/devtools/winforms/getting-started/first-steps)
* [Telerik UI for WinForms Setup](https://docs.telerik.com/devtools/winforms/installation-and-upgrades/installing-on-your-computer)
diff --git a/controls/editors/textbox/programming-radtextbox.md b/controls/editors/textbox/programming-radtextbox.md
index 50a19eead..2629d07a9 100644
--- a/controls/editors/textbox/programming-radtextbox.md
+++ b/controls/editors/textbox/programming-radtextbox.md
@@ -52,21 +52,10 @@ Since R2 2021 **RadTextBox** supports embedded labels. The embedded label shows
#### Example 1: Setting the embedded label
-{{source=..\SamplesCS\Editors\TextBox1.cs region=EmbeddedLabel}}
-{{source=..\SamplesVB\Editors\TextBox1.vb region=EmbeddedLabel}}
+
+
-````C#
-this.radTextBox1.ShowEmbeddedLabel = true;
-this.radTextBox1.EmbeddedLabelText = "First Name";
-````
-````VB.NET
-Me.RadTextBox1.ShowEmbeddedLabel = True
-Me.RadTextBox1.EmbeddedLabelText = "First Name"
-
-````
-
-{{endregion}}

diff --git a/controls/editors/textboxcontrol/autocomplete.md b/controls/editors/textboxcontrol/autocomplete.md
index e2c1735f6..9012812d0 100644
--- a/controls/editors/textboxcontrol/autocomplete.md
+++ b/controls/editors/textboxcontrol/autocomplete.md
@@ -65,49 +65,10 @@ To set the __AutoCompleteDisplayMember__ property, first set the data source pro
To use auto-completion without specifying a data source, you need to populate the items which will be used for completing the input string in __RadTextBoxControl__, in the __Items__ collection of the control:
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=AddAutoCompleteItems}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=AddAutoCompleteItems}}
-
-````C#
-
-private void AddAutoCompleteItems()
-{
- this.radTextBoxControl1.AutoCompleteMode = AutoCompleteMode.Suggest;
- RadListDataItemCollection autoCompleteItems = this.radTextBoxControl1.AutoCompleteItems;
-
- autoCompleteItems.Add(new RadListDataItem("Luke"));
- autoCompleteItems.Add(new RadListDataItem("Max"));
- autoCompleteItems.Add(new RadListDataItem("Adam"));
- autoCompleteItems.Add(new RadListDataItem("Henry"));
- autoCompleteItems.Add(new RadListDataItem("Jack"));
- autoCompleteItems.Add(new RadListDataItem("Ben"));
- autoCompleteItems.Add(new RadListDataItem("Tyler"));
- autoCompleteItems.Add(new RadListDataItem("Ethan"));
- autoCompleteItems.Add(new RadListDataItem("David"));
- autoCompleteItems.Add(new RadListDataItem("Mike"));
-}
-
-````
-````VB.NET
-Private Sub AddAutoCompleteItems()
- Me.RadTextBoxControl1.AutoCompleteMode = AutoCompleteMode.Suggest
- Dim autoCompleteItems As RadListDataItemCollection = Me.RadTextBoxControl1.AutoCompleteItems
- autoCompleteItems.Add(New RadListDataItem("Luke"))
- autoCompleteItems.Add(New RadListDataItem("Max"))
- autoCompleteItems.Add(New RadListDataItem("Adam"))
- autoCompleteItems.Add(New RadListDataItem("Henry"))
- autoCompleteItems.Add(New RadListDataItem("Jack"))
- autoCompleteItems.Add(New RadListDataItem("Ben"))
- autoCompleteItems.Add(New RadListDataItem("Tyler"))
- autoCompleteItems.Add(New RadListDataItem("Ethan"))
- autoCompleteItems.Add(New RadListDataItem("David"))
- autoCompleteItems.Add(New RadListDataItem("Mike"))
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
Here is the result of the above code:
@@ -119,42 +80,17 @@ Here is the result of the above code:
The bellow example shows how you can change the styles of the auto-complete drop down.
First you need to subscribe to the __VisualItemFormatting__ event:
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=Subscribe_ItemFormatting}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=Subscribe_ItemFormatting}}
-````C#
-radTextBoxControl1.ListElement.VisualItemFormatting += ListElement_VisualItemFormatting;
+
+
-````
-````VB.NET
-AddHandler RadTextBoxControl1.ListElement.VisualItemFormatting, AddressOf ListElement_VisualItemFormatting
-````
-
-{{endregion}}
Then you can change the styles in the event handler:
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=Formatting_AutoComplete}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=Formatting_AutoComplete}}
-````C#
-private void ListElement_VisualItemFormatting(object sender, VisualItemFormattingEventArgs args)
-{
- args.VisualItem.BackColor = ColorTranslator.FromHtml("#91c930");
- args.VisualItem.GradientStyle = GradientStyles.Solid;
- args.VisualItem.ForeColor = ColorTranslator.FromHtml("#bb2525");
-}
-
-````
-````VB.NET
-Private Sub ListElement_VisualItemFormatting(ByVal sender As Object, ByVal args As VisualItemFormattingEventArgs)
- args.VisualItem.BackColor = ColorTranslator.FromHtml("#91c930")
- args.VisualItem.GradientStyle = GradientStyles.Solid
- args.VisualItem.ForeColor = ColorTranslator.FromHtml("#bb2525")
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
Here is the result of the above code:
diff --git a/controls/editors/textboxcontrol/caret-positioning-and-selection.md b/controls/editors/textboxcontrol/caret-positioning-and-selection.md
index 7596cf63a..a82bdbdb7 100644
--- a/controls/editors/textboxcontrol/caret-positioning-and-selection.md
+++ b/controls/editors/textboxcontrol/caret-positioning-and-selection.md
@@ -25,53 +25,18 @@ The __SelectionLength__ property is a numeric value that sets the width of the i
#### Select part of the text using the __SelectionStart__ and __SelectionLenght__ properties.
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=SetSelection}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=SetSelection}}
-
-````C#
-
-private void SetSelection()
-{
- this.radTextBoxControl1.Text = "Hello, John Green";
- this.radTextBoxControl1.SelectionStart = 7;
- this.radTextBoxControl1.SelectionLength = 4;
-}
-
-````
-````VB.NET
-Private Sub SetSelection()
- Me.RadTextBoxControl1.Text = "Hello, John Green"
- Me.RadTextBoxControl1.SelectionStart = 7
- Me.RadTextBoxControl1.SelectionLength = 4
-End Sub
-
-````
-
-{{endregion}}
-
-#### Use the __Select__ method to select the part of the text:
+
+
+
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=Select}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=Select}}
-````C#
-private void SelectText()
-{
- this.radTextBoxControl1.Text = "Hello, John Green";
- this.radTextBoxControl1.Select(7, 4);
-}
+#### Use the __Select__ method to select the part of the text:
+
+
+
-````
-````VB.NET
-Private Sub SelectText()
- Me.RadTextBoxControl1.Text = "Hello, John Green"
- Me.RadTextBoxControl1.[Select](7, 4)
-End Sub
-````
-{{endregion}}
-
The both approaches produce same result:

diff --git a/controls/editors/textboxcontrol/creating-custom-blocks.md b/controls/editors/textboxcontrol/creating-custom-blocks.md
index 39359b43c..d7b2ec7af 100644
--- a/controls/editors/textboxcontrol/creating-custom-blocks.md
+++ b/controls/editors/textboxcontrol/creating-custom-blocks.md
@@ -20,231 +20,29 @@ You should create a custom text block that inherits from __ITextBlock__ and any
First, you should create a button that implements __ITextBlock__ interface:
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=customTextBlock}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=customTextBlock}}
+
+
-````C#
-
-public class ButtonTextBlock : RadButtonElement, ITextBlock
-{
- private int index;
- private int offset;
- public ButtonTextBlock()
- {
- this.index = 0;
- this.offset = 0;
- this.MaxSize = new Size(0, 12);
- }
-
- protected override Type ThemeEffectiveType
- {
- get
- {
- return typeof(RadButtonElement);
- }
- }
-
- public int Index
- {
- get
- {
- return this.index;
- }
- set
- {
- this.index = value;
- }
- }
-
- public int Length
- {
- get
- {
- return 1;
- }
- }
-
- public int Offset
- {
- get
- {
- return this.offset;
- }
- set
- {
- this.offset = value;
- }
- }
-
- public int GetCharacterIndexFromX(float x)
- {
- RectangleF bounds = this.ControlBoundingRectangle;
- float median = bounds.X + bounds.Width / 2;
- return x <= median ? 0 : 1;
- }
-
- public RectangleF GetRectangleFromCharacterIndex(int index, bool trailEdge)
- {
- Rectangle bounds = this.ControlBoundingRectangle;
-
- if (index == 1)
- {
- bounds.X = bounds.Right;
- bounds.Width = 0;
- }
-
- return bounds;
- }
-
- protected override void OnClick(EventArgs e)
- {
- base.OnClick(e);
- RadMessageBox.Show("The button is clicked.", "Message");
- }
-}
-````
-````VB.NET
-
-Public Class ButtonTextBlock
-Inherits RadButtonElement
-Implements ITextBlock
- Private m_index As Integer
- Private m_offset As Integer
- Public Sub New()
- Me.m_index = 0
- Me.m_offset = 0
- Me.MaxSize = New Size(0, 12)
- End Sub
- Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
- Get
- Return GetType(RadButtonElement)
- End Get
- End Property
- Public Property Index() As Integer Implements ITextBlock.Index
- Get
- Return Me.m_index
- End Get
- Set(value As Integer)
- Me.m_index = value
- End Set
- End Property
- Public ReadOnly Property Length() As Integer Implements ITextBlock.Length
- Get
- Return 1
- End Get
- End Property
- Public Property Offset() As Integer Implements ITextBlock.Offset
- Get
- Return Me.m_offset
- End Get
- Set(value As Integer)
- Me.m_offset = value
- End Set
- End Property
- Public Function GetCharacterIndexFromX(x As Single) As Integer Implements ITextBlock.GetCharacterIndexFromX
- Dim bounds As RectangleF = Me.ControlBoundingRectangle
- Dim median As Single = bounds.X + bounds.Width / 2
- Return If(x <= median, 0, 1)
- End Function
- Public Function GetRectangleFromCharacterIndex(index As Integer, trailEdge As Boolean) As RectangleF Implements ITextBlock.GetRectangleFromCharacterIndex
- Dim bounds As Rectangle = Me.ControlBoundingRectangle
- If index = 1 Then
- bounds.X = bounds.Right
- bounds.Width = 0
- End If
-
- Return bounds
- End Function
- Protected Overrides Sub OnClick(e As EventArgs)
- MyBase.OnClick(e)
- RadMessageBox.Show("The button is clicked.", "Message")
- End Sub
- Overloads Sub Measure(availableSize As SizeF) Implements ITextBlock.Measure
- MyBase.Measure(availableSize)
- End Sub
- Overloads Sub Arrange(finalRectangle As RectangleF) Implements ITextBlock.Arrange
- MyBase.Arrange(finalRectangle)
- End Sub
- Overloads ReadOnly Property DesiredSize As SizeF Implements ITextBlock.DesiredSize
- Get
- Return MyBase.DesiredSize
- End Get
- End Property
- Overloads ReadOnly Property ControlBoundingRectangle As Rectangle Implements ITextBlock.ControlBoundingRectangle
- Get
- Return MyBase.ControlBoundingRectangle
- End Get
- End Property
- Overloads Property Text As String Implements ITextBlock.Text
- Get
- Return MyBase.Text
- End Get
- Set(value As String)
- MyBase.Text = value
- End Set
- End Property
-End Class
-
-````
-{{endregion}}
-
Then you should subscribe to the __CreateTextBlock__ event before initializing the __Text__ property:
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=applyCustomTextBlock1}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=applyCustomTextBlock1}}
-````C#
-
-radTextBoxControl1.CreateTextBlock += new CreateTextBlockEventHandler(radTextBoxControl1_CreateTextBlock);
-
-````
-````VB.NET
-AddHandler RadTextBoxControl1.CreateTextBlock, AddressOf radTextBoxControl1_CreateTextBlock
+
+
-````
-{{endregion}}
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=applyCustomTextBlock2}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=applyCustomTextBlock2}}
+
+
-````C#
-void radTextBoxControl1_CreateTextBlock(object sender, CreateTextBlockEventArgs e)
-{
- if (e.Text == "here")
- {
- e.TextBlock = new ButtonTextBlock();
- }
-}
-````
-````VB.NET
-Private Sub radTextBoxControl1_CreateTextBlock(sender As Object, e As CreateTextBlockEventArgs)
- If e.Text = "here" Then
- e.TextBlock = New ButtonTextBlock()
- End If
-End Sub
-````
-
-{{endregion}}
-
Finally, the __Text__ property should be set:
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=applyCustomTextBlock3}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=applyCustomTextBlock3}}
-
-````C#
-this.radTextBoxControl1.Text = "Please, click here";
-
-````
-````VB.NET
-Me.RadTextBoxControl1.Text = "Please, click here"
+
+
-````
-{{endregion}}
>caption Figure 1: The "here" word is replaced with a button.
diff --git a/controls/editors/textboxcontrol/customizing-appearance/formatting-blocks.md b/controls/editors/textboxcontrol/customizing-appearance/formatting-blocks.md
index 5eeb03d22..1181324fe 100644
--- a/controls/editors/textboxcontrol/customizing-appearance/formatting-blocks.md
+++ b/controls/editors/textboxcontrol/customizing-appearance/formatting-blocks.md
@@ -15,50 +15,16 @@ The RadTextBoxControl allow appearance customization of each instance of __IText
#### Subscribing to TextBlockFormatting event
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=Formatting1}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=Formatting1}}
-````C#
-
-this.radTextBoxControl1.TextBlockFormatting += this.OnTextBlockFormatting;
-this.radTextBoxControl1.Text = "This is important text.";
+
+
-````
-````VB.NET
-AddHandler Me.RadTextBoxControl1.TextBlockFormatting, AddressOf Me.OnTextBlockFormatting
-Me.RadTextBoxControl1.Text = "This is important text."
-````
-
-{{endregion}}
#### The TextBlockFormatting event handler
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=formatting2}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=formatting2}}
-
-````C#
-
-private void OnTextBlockFormatting(object sender, Telerik.WinControls.UI.TextBlockFormattingEventArgs e)
-{
- TextBlockElement textBlock = e.TextBlock as TextBlockElement;
- if (textBlock != null && e.TextBlock.Text == "important")
- {
- textBlock.ForeColor = Color.Red;
- }
-}
-
-````
-````VB.NET
-Private Sub OnTextBlockFormatting(sender As Object, e As Telerik.WinControls.UI.TextBlockFormattingEventArgs)
- Dim textBlock As TextBlockElement = TryCast(e.TextBlock, TextBlockElement)
- If textBlock IsNot Nothing AndAlso e.TextBlock.Text = "important" Then
- textBlock.ForeColor = Color.Red
- End If
-End Sub
-
-````
+
+
-{{endregion}}

diff --git a/controls/editors/textboxcontrol/getting-started.md b/controls/editors/textboxcontrol/getting-started.md
index 2d218373f..4a6c1750a 100644
--- a/controls/editors/textboxcontrol/getting-started.md
+++ b/controls/editors/textboxcontrol/getting-started.md
@@ -41,107 +41,40 @@ The text displayed by the control resides in the __Text__ property. It can be se
The code below sets text in the control at run time:
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=SetText}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=SetText}}
+
+
-````C#
-
-private void SetDefaultText()
-{
- this.radTextBoxControl1.Text = "Type your name here.";
-}
-
-````
-````VB.NET
-Private Sub SetDefaultText()
- Me.RadTextBoxControl1.Text = "Type your name here."
-End Sub
-
-````
-{{endregion}}
>caption Figure 1: Set the text at runtime.

You can also define the lines in the text box at run time:
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=Lines}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=Lines}}
+
+
+
-````C#
-
-private void SetLines()
-{
- string[] lines = new string[]
- {
- "Dear Sir or Madam,",
- "I writing to you regarding your publication in Daily Mail.",
- "Could you give me the resources that you have used?"
- };
- this.radTextBoxControl1.Lines = lines;
-}
-
-````
-````VB.NET
-Private Sub SetLines()
- Dim lines As String() = New String() {"Dear Sir or Madam,", "I writing to you regarding your publication in Daily Mail.", "Could you give me the resources that you have used?"}
- Me.RadTextBoxControl1.Lines = lines
-End Sub
-
-````
-
-{{endregion}}
>caption Figure 2: Set the lines of a multiline text box.

By setting the __NullText__ property, the control will display a custom string when the __Text__ property is empty or null:
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=SetNullText}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=SetNullText}}
+
+
-````C#
-
-private void SetNullText()
-{
- this.radTextBoxControl1.NullText = "Type your name...";
-}
-````
-````VB.NET
-Private Sub SetNullText()
- Me.RadTextBoxControl1.NullText = "Type your name..."
-End Sub
-
-````
-
-{{endregion}}
>caption Figure 3: Setting the null text.

Based on the value set to the __TextAlign__ property, the control will display its content aligned to the left, center or right:
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=SetTextAlign}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=SetTextAlign}}
-
-````C#
-
-public void SetTextAlign()
-{
- this.radTextBoxControl1.TextAlign = HorizontalAlignment.Left;
-}
-
-````
-````VB.NET
-Private Sub SetTextAlign()
- Me.RadTextBoxControl1.TextAlign = HorizontalAlignment.Left
-End Sub
+
+
-````
-{{endregion}}
>caption Figure 4: Aligning the text to different positions.

diff --git a/controls/editors/textboxcontrol/localization.md b/controls/editors/textboxcontrol/localization.md
index 4c232c0f9..741b80aa1 100644
--- a/controls/editors/textboxcontrol/localization.md
+++ b/controls/editors/textboxcontrol/localization.md
@@ -84,9 +84,6 @@ To apply the custom localization provider, instantiate and assign it to the cur
TextBoxControlLocalizationProvider.CurrentProvider = New CustomTextBoxControlLocalizationProvider()
````
-
-{{endregion}}
-
# See Also
* [AutoComplete]({%slug winforms/editors/textboxcontrol/autocomplete%})
diff --git a/controls/editors/textboxcontrol/properties.md b/controls/editors/textboxcontrol/properties.md
index ff8f8ce73..0fabe64f7 100644
--- a/controls/editors/textboxcontrol/properties.md
+++ b/controls/editors/textboxcontrol/properties.md
@@ -55,23 +55,10 @@ Since R2 2021 **RadTextBoxControl** supports embedded labels. The embedded label
#### Example 1: Setting the embedded label
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=EmbeddedLabels}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=EmbeddedLabels}}
+
+
-````C#
-this.radTextBoxControl1.ShowEmbeddedLabel = true;
-this.radTextBoxControl1.AutoSize = true;
-this.radTextBoxControl1.EmbeddedLabelText = "First Name";
-````
-````VB.NET
-Me.RadTextBoxControl1.ShowEmbeddedLabel = True
-Me.RadTextBoxControl1.AutoSize = True
-Me.RadTextBoxControl1.EmbeddedLabelText = "First Name"
-
-````
-
-{{endregion}}

diff --git a/controls/editors/textboxcontrol/text-editing.md b/controls/editors/textboxcontrol/text-editing.md
index 584ffa200..2b4b0b6f5 100644
--- a/controls/editors/textboxcontrol/text-editing.md
+++ b/controls/editors/textboxcontrol/text-editing.md
@@ -17,29 +17,11 @@ The editing point is determined by the caret position and selection in __RadText
You can insert text programmatically at concrete position by using the __Insert__ method. At that case, the text is inserted at the position determined by the __SelectionStart__ property. If the __SelectionLength__ property is greater than zero, the inserted text replaces the selected text.
#### Insert string.
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=Insert}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=Insert}}
-
-````C#
-private void Insert()
-{
- this.radTextBoxControl1.Text = "Green";
- this.radTextBoxControl1.CaretIndex = 0;
- this.radTextBoxControl1.Insert("John ");
-}
-
-````
-````VB.NET
-Private Sub Insert()
- Me.RadTextBoxControl1.Text = "Green"
- Me.RadTextBoxControl1.CaretIndex = 0
- Me.RadTextBoxControl1.Insert("John ")
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
+
>caption Figure 1: The string is inserted at the specified position.

@@ -47,27 +29,11 @@ End Sub
Alternatively, you can insert text at the end of the RadTextBoxControl content by using the __AppendText__ method:
### Append specific string.
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=AppendText}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=AppendText}}
-
-````C#
-private void AppendText()
-{
- this.radTextBoxControl1.Text = "Samuel";
- this.radTextBoxControl1.AppendText(" Jackson");
-}
-
-````
-````VB.NET
-Private Sub AppendText()
- Me.RadTextBoxControl1.Text = "Samuel"
- Me.RadTextBoxControl1.AppendText(" Jackson")
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
+
>caption Figure 2: The string is added at the end of the existing text.

@@ -75,29 +41,11 @@ End Sub
You can delete the selected text or character at the caret position by using the __Delete__ method:
#### Select and delete a word.
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=Delete}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=Delete}}
-
-````C#
-private void DeleteSelection()
-{
- this.radTextBoxControl1.Text = "John Green";
- this.radTextBoxControl1.Select(0, 4);
- this.radTextBoxControl1.Delete();
-}
-
-````
-````VB.NET
-Private Sub DeleteSelection()
- Me.RadTextBoxControl1.Text = "John Green"
- Me.RadTextBoxControl1.[Select](0, 4)
- Me.RadTextBoxControl1.Delete()
-End Sub
-
-````
-
-{{endregion}}
-
+
+
+
+
+
>caption Figure 3: The first word is deleted.

@@ -106,25 +54,10 @@ Each editing operation raises the __TextChanging__ and __TextChanged__ events. N
#### Cancel the ex changing if the entire text is deleted.
-{{source=..\SamplesCS\Editors\TextBoxControl.cs region=TextChanging}}
-{{source=..\SamplesVB\Editors\TextBoxControl.vb region=TextChanging}}
-
-````C#
-
-private void radTextBoxControl1_TextChanging(object sender, Telerik.WinControls.TextChangingEventArgs e)
-{
- e.Cancel = string.IsNullOrEmpty(e.NewValue);
-}
-
-````
-````VB.NET
-Private Sub radTextBoxControl1_TextChanging(sender As Object, e As Telerik.WinControls.TextChangingEventArgs)
- e.Cancel = String.IsNullOrEmpty(e.NewValue)
-End Sub
+
+
-````
-{{endregion}}
# See Also
diff --git a/controls/editors/timeonlypicker/customizing-appearance/customizing-programatically.md b/controls/editors/timeonlypicker/customizing-appearance/customizing-programatically.md
index 476e800fc..1251303d7 100644
--- a/controls/editors/timeonlypicker/customizing-appearance/customizing-programatically.md
+++ b/controls/editors/timeonlypicker/customizing-appearance/customizing-programatically.md
@@ -96,9 +96,6 @@ Me.RadTimeOnlyPicker1.TimeOnlyPickerElement.PopupContentElement.ClockHeaderEleme
Me.RadTimeOnlyPicker1.TimeOnlyPickerElement.PopupContentElement.ClockElement.SecondsArrow.Visibility = Telerik.WinControls.ElementVisibility.Collapsed
````
-
-{{endregion}}
-

## Customize hours and minutes headers
@@ -196,9 +193,6 @@ Me.RadTimeOnlyPicker1.TimeOnlyPickerElement.PopupContentElement.MinutesTable.Gra
Me.RadTimeOnlyPicker1.TimeOnlyPickerElement.PopupContentElement.MinutesTable.BackColor = Color.Blue
````
-
-{{endregion}}
-

## Customize Button Panel
diff --git a/controls/editors/timepicker/customizing-appearance/customizing-programatically.md b/controls/editors/timepicker/customizing-appearance/customizing-programatically.md
index abd68e63f..d20fcc3ec 100644
--- a/controls/editors/timepicker/customizing-appearance/customizing-programatically.md
+++ b/controls/editors/timepicker/customizing-appearance/customizing-programatically.md
@@ -18,22 +18,10 @@ Each of the control's elements can be accessed and customized. At the [Structure
For example the editable area of the control consist of __RadTextBoxItem__ hosted in __RadMaskedEditBoxElement__. So in order to customize the text box __BackColor__ you need to set both the __BackColor__ of the __RadTextBoxItem__ and of the __RadMaskedEditBoxElement__ `FillPrimitive`:
-{{source=..\SamplesCS\Editors\TimePicker1.cs region=CustomizeTextBox}}
-{{source=..\SamplesVB\Editors\TimePicker1.vb region=CustomizeTextBox}}
+
+
-````C#
-radTimePicker1.TimePickerElement.MaskedEditBox.Fill.BackColor = Color.Red;
-radTimePicker1.TimePickerElement.MaskedEditBox.TextBoxItem.BackColor = Color.Red;
-````
-````VB.NET
-RadTimePicker1.TimePickerElement.MaskedEditBox.Fill.BackColor = Color.Red
-RadTimePicker1.TimePickerElement.MaskedEditBox.TextBoxItem.BackColor = Color.Red
-
-````
-
-{{endregion}}
-

@@ -41,20 +29,10 @@ RadTimePicker1.TimePickerElement.MaskedEditBox.TextBoxItem.BackColor = Color.Red
Here is how you can set some left and right padding of the drop down button:
-{{source=..\SamplesCS\Editors\TimePicker1.cs region=CustomizeDropDownButton}}
-{{source=..\SamplesVB\Editors\TimePicker1.vb region=CustomizeDropDownButton}}
-
-````C#
-radTimePicker1.TimePickerElement.DropDownButton.Padding = new Padding(10,0,10,0);
+
+
-````
-````VB.NET
-RadTimePicker1.TimePickerElement.DropDownButton.Padding = New Windows.Forms.Padding(10, 0, 10, 0)
-````
-
-{{endregion}}
-

@@ -62,25 +40,10 @@ RadTimePicker1.TimePickerElement.DropDownButton.Padding = New Windows.Forms.Padd
Here is how to access and set the border color of the arrow buttons:
-{{source=..\SamplesCS\Editors\TimePicker1.cs region=CustomizeArrowButtons}}
-{{source=..\SamplesVB\Editors\TimePicker1.vb region=CustomizeArrowButtons}}
-
-````C#
-radTimePicker1.TimePickerElement.UpButton.Border.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
-radTimePicker1.TimePickerElement.UpButton.Border.ForeColor = Color.Blue;
-radTimePicker1.TimePickerElement.DownButton.Border.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
-radTimePicker1.TimePickerElement.DownButton.Border.ForeColor = Color.Blue;
+
+
-````
-````VB.NET
-RadTimePicker1.TimePickerElement.UpButton.Border.GradientStyle = Telerik.WinControls.GradientStyles.Solid
-RadTimePicker1.TimePickerElement.UpButton.Border.ForeColor = Color.Blue
-RadTimePicker1.TimePickerElement.DownButton.Border.GradientStyle = Telerik.WinControls.GradientStyles.Solid
-RadTimePicker1.TimePickerElement.DownButton.Border.ForeColor = Color.Blue
-````
-
-{{endregion}}

@@ -88,29 +51,10 @@ RadTimePicker1.TimePickerElement.DownButton.Border.ForeColor = Color.Blue
Here is how to change the clock header background and font and also how to hide the seconds arrow from the clock:
-{{source=..\SamplesCS\Editors\TimePicker1.cs region=CustomizeClock}}
-{{source=..\SamplesVB\Editors\TimePicker1.vb region=CustomizeClock}}
-
-````C#
-//customize header
-radTimePicker1.TimePickerElement.PopupContentElement.ClockHeaderElement.Font = new System.Drawing.Font("Arial", 22);
-radTimePicker1.TimePickerElement.PopupContentElement.ClockHeaderElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
-radTimePicker1.TimePickerElement.PopupContentElement.ClockHeaderElement.BackColor = Color.YellowGreen;
-//hide seconds arrow
-radTimePicker1.TimePickerElement.PopupContentElement.ClockElement.SecondsArrow.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
+
+
-````
-````VB.NET
-
-RadTimePicker1.TimePickerElement.PopupContentElement.ClockHeaderElement.Font = New System.Drawing.Font("Arial", 22)
-RadTimePicker1.TimePickerElement.PopupContentElement.ClockHeaderElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid
-RadTimePicker1.TimePickerElement.PopupContentElement.ClockHeaderElement.BackColor = Color.YellowGreen
-
-RadTimePicker1.TimePickerElement.PopupContentElement.ClockElement.SecondsArrow.Visibility = Telerik.WinControls.ElementVisibility.Collapsed
-````
-
-{{endregion}}

@@ -118,33 +62,10 @@ RadTimePicker1.TimePickerElement.PopupContentElement.ClockElement.SecondsArrow.V
This code snippet demonstrates how to change the hours header back color and the minutes header border appearance:
-{{source=..\SamplesCS\Editors\TimePicker1.cs region=CustomizeHoursAndMinutesHeaders}}
-{{source=..\SamplesVB\Editors\TimePicker1.vb region=CustomizeHoursAndMinutesHeaders}}
-
-````C#
-//hours header
-radTimePicker1.TimePickerElement.PopupContentElement.HoursTable.TableHeader.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
-radTimePicker1.TimePickerElement.PopupContentElement.HoursTable.TableHeader.BackColor = Color.Yellow;
-//minutes header
-radTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.TableHeader.HeaderElement.DrawBorder = true;
-radTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.TableHeader.HeaderElement.BorderWidth = 3;
-radTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.TableHeader.HeaderElement.BorderColor = Color.Red;
-radTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.TableHeader.HeaderElement.BorderGradientStyle = Telerik.WinControls.GradientStyles.Solid;
-
-````
-````VB.NET
-
-RadTimePicker1.TimePickerElement.PopupContentElement.HoursTable.TableHeader.GradientStyle = Telerik.WinControls.GradientStyles.Solid
-RadTimePicker1.TimePickerElement.PopupContentElement.HoursTable.TableHeader.BackColor = Color.Yellow
-
-RadTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.TableHeader.HeaderElement.DrawBorder = True
-RadTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.TableHeader.HeaderElement.BorderWidth = 3
-RadTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.TableHeader.HeaderElement.BorderColor = Color.Red
-RadTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.TableHeader.HeaderElement.BorderGradientStyle = Telerik.WinControls.GradientStyles.Solid
+
+
-````
-{{endregion}}

@@ -152,43 +73,10 @@ RadTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.TableHeader.He
The cells in both minutes and hours tables are placed in a GridLayout. To customize the cells, you can use the TimeCellFormatting event of the control:
-{{source=..\SamplesCS\Editors\TimePicker1.cs region=CellFormatting}}
-{{source=..\SamplesVB\Editors\TimePicker1.vb region=CellFormatting}}
-
-````C#
-void radTimePicker1_TimeCellFormatting(object sender, Telerik.WinControls.UI.TimeCellFormattingEventArgs e)
-{
- e.Element.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
- e.Element.Margin = new Padding(2);
- if (e.IsMinute)
- {
- //set minute cells specific properties
- e.Element.BackColor = Color.Lime;
- }
- else
- {
- //set hours cells specific properties
- e.Element.BackColor = Color.Green;
- }
-}
-
-````
-````VB.NET
-Private Sub radTimePicker1_TimeCellFormatting(sender As Object, e As Telerik.WinControls.UI.TimeCellFormattingEventArgs)
- e.Element.GradientStyle = Telerik.WinControls.GradientStyles.Solid
- e.Element.Margin = New Windows.Forms.Padding(2)
- If e.IsMinute Then
-
- e.Element.BackColor = Color.Lime
- Else
-
- e.Element.BackColor = Color.Green
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+

@@ -196,33 +84,10 @@ End Sub
This is how you can set the hours and minutes tables background color:
-{{source=..\SamplesCS\Editors\TimePicker1.cs region=CustomizeHoursAndMinutesTables}}
-{{source=..\SamplesVB\Editors\TimePicker1.vb region=CustomizeHoursAndMinutesTables}}
-
-````C#
-//hours table
-radTimePicker1.TimePickerElement.PopupContentElement.HoursTable.DrawFill = true;
-radTimePicker1.TimePickerElement.PopupContentElement.HoursTable.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
-radTimePicker1.TimePickerElement.PopupContentElement.HoursTable.BackColor = Color.Red;
-//minutes table
-radTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.DrawFill = true;
-radTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
-radTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.BackColor = Color.Blue;
-
-````
-````VB.NET
-
-RadTimePicker1.TimePickerElement.PopupContentElement.HoursTable.DrawFill = True
-RadTimePicker1.TimePickerElement.PopupContentElement.HoursTable.GradientStyle = Telerik.WinControls.GradientStyles.Solid
-RadTimePicker1.TimePickerElement.PopupContentElement.HoursTable.BackColor = Color.Red
-
-RadTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.DrawFill = True
-RadTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.GradientStyle = Telerik.WinControls.GradientStyles.Solid
-RadTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.BackColor = Color.Blue
-
-````
-
-{{endregion}}
+
+
+
+

@@ -230,19 +95,10 @@ RadTimePicker1.TimePickerElement.PopupContentElement.MinutesTable.BackColor = Co
Here is how to change the BackColor of the FooterPanel:
-{{source=..\SamplesCS\Editors\TimePicker1.cs region=CustomizeFooterPanel}}
-{{source=..\SamplesVB\Editors\TimePicker1.vb region=CustomizeFooterPanel}}
-
-````C#
-radTimePicker1.TimePickerElement.PopupContentElement.FooterPanel.BackColor = Color.BlanchedAlmond;
-
-````
-````VB.NET
-RadTimePicker1.TimePickerElement.PopupContentElement.FooterPanel.BackColor = Color.BlanchedAlmond
+
+
-````
-{{endregion}}

diff --git a/controls/editors/timepicker/free-form-date-time-parsing.md b/controls/editors/timepicker/free-form-date-time-parsing.md
index b759bdcaf..b8e0d63d2 100644
--- a/controls/editors/timepicker/free-form-date-time-parsing.md
+++ b/controls/editors/timepicker/free-form-date-time-parsing.md
@@ -17,20 +17,9 @@ From Q2 2014 we introduced new MaskType of RadMaskedEditBox that is designed to
The embedded text editor of RadTimePicker is RadMaskedEditBox. So if you want to take the advantages from new DateTime parsing logic the only thing that you should to do is to change the MaskType of embedded editor.
-{{source=..\SamplesCS\Editors\TimePicker1.cs region=FreeFormDateTimeTimePicker}}
-{{source=..\SamplesVB\Editors\TimePicker1.vb region=FreeFormDateTimeTimePicker}}
-
-````C#
-
-this.radTimePicker1.TimePickerElement.MaskedEditBox.MaskType = MaskType.FreeFormDateTime;
-
-````
-````VB.NET
-Me.RadTimePicker1.TimePickerElement.MaskedEditBox.MaskType = MaskType.FreeFormDateTime
-
-````
-
-{{endregion}}
-
-
+
+
+
+
+
##
diff --git a/controls/editors/timepicker/localization.md b/controls/editors/timepicker/localization.md
index f6e978cd8..b754863f6 100644
--- a/controls/editors/timepicker/localization.md
+++ b/controls/editors/timepicker/localization.md
@@ -23,66 +23,20 @@ Below is a sample implementation of an English localization provider:
#### Localizing RadTimePicker Strings
-{{source=..\SamplesCS\Editors\TimePicker1.cs region=LocalizationProvider}}
-{{source=..\SamplesVB\Editors\TimePicker1.vb region=LocalizationProvider}}
-
-````C#
-class MyTimePickerLocalizationProvider : RadTimePickerLocalizationProvider
-{
- public override string GetLocalizedString(string id)
- {
- switch (id)
- {
- case RadTimePickerStringId.HourHeaderText: return "Hours";
- case RadTimePickerStringId.MinutesHeaderText: return "Minutes";
- case RadTimePickerStringId.CloseButtonText: return "Close";
- default: return string.Empty;
- }
- }
-}
-
-````
-````VB.NET
-Class MyTimePickerLocalizationProvider
- Inherits RadTimePickerLocalizationProvider
- Public Overrides Function GetLocalizedString(id As String) As String
- Select Case id
- Case RadTimePickerStringId.HourHeaderText
- Return "Hours"
- Case RadTimePickerStringId.MinutesHeaderText
- Return "Minutes"
- Case RadTimePickerStringId.CloseButtonText
- Return "Close"
- Case Else
- Return String.Empty
- End Select
- End Function
-End Class
-
-````
-
-{{endregion}}
-
-
+
+
+
+
+
To apply the custom localization provider, instantiate and assign it to the current localization provider:
#### Assigning the Current Localization Provider
-{{source=..\SamplesCS\Editors\TimePicker1.cs region=settingTheLocalizationProvider}}
-{{source=..\SamplesVB\Editors\TimePicker1.vb region=settingTheLocalizationProvider}}
-
-````C#
-RadTimePickerLocalizationProvider.CurrentProvider = new MyTimePickerLocalizationProvider();
-
-````
-````VB.NET
-RadTimePickerLocalizationProvider.CurrentProvider = New MyTimePickerLocalizationProvider()
-
-````
-
-{{endregion}}
-
-
+
+
+
+
+
The code provided above illustrates the approach to be used to localize the __RadTimePicker__ and is not intended as a full translation.
# See Also
diff --git a/controls/editors/timespanpicker/customizing-appearance/customizing-appearance.md b/controls/editors/timespanpicker/customizing-appearance/customizing-appearance.md
index 1a43d099b..2879ea043 100644
--- a/controls/editors/timespanpicker/customizing-appearance/customizing-appearance.md
+++ b/controls/editors/timespanpicker/customizing-appearance/customizing-appearance.md
@@ -28,69 +28,10 @@ The drop down consist of several **ListControlElements** which represent the tim
#### Formating Items in the Popup
-{{source=..\SamplesCS\Editors\TimeSpanCode.cs region=Formatting}}
-{{source=..\SamplesVB\Editors\TimeSpanCode.vb region=Formatting}}
-````C#
-protected override void OnLoad(EventArgs e)
-{
- base.OnLoad(e);
- radTimeSpanPicker1.PopupContentElement.ComponentsCreated += PopupContentElement_ComponentsCreated;
-}
-private void PopupContentElement_ComponentsCreated(object sender, EventArgs e)
-{
- foreach (ITimeSpanPickerComponent component in radTimeSpanPicker1.PopupContentElement.Components)
- {
- ListTimeSpanPickerUIComponent listUiCompoinent = component.TimeSpanPickerUIComponent as ListTimeSpanPickerUIComponent;
- listUiCompoinent.ListElement.Tag = this.radTimeSpanPicker1.PopupContentElement.Components.IndexOf(component as RadItem);
- listUiCompoinent.ListElement.VisualItemFormatting += ListElement_VisualItemFormatting;
- }
-}
-private void ListElement_VisualItemFormatting(object sender, VisualItemFormattingEventArgs args)
-{
- int componentIndex = (int)args.VisualItem.Data.Owner.Tag;
- if (componentIndex == 1)
- {
- args.VisualItem.BackColor = ColorTranslator.FromHtml("#f5c020");
- args.VisualItem.ForeColor = ColorTranslator.FromHtml("#008de7");
- args.VisualItem.GradientStyle = GradientStyles.Solid;
- }
- else
- {
- args.VisualItem.ResetValue(RadListVisualItem.BackColorProperty, ValueResetFlags.Local);
- args.VisualItem.ResetValue(RadListVisualItem.GradientStyleProperty, ValueResetFlags.Local);
- args.VisualItem.ResetValue(RadListVisualItem.ForeColorProperty, ValueResetFlags.Local);
- }
-}
-
-````
-````VB.NET
-Protected Overrides Sub OnLoad(ByVal e As EventArgs)
- MyBase.OnLoad(e)
- AddHandler radTimeSpanPicker1.PopupContentElement.ComponentsCreated, AddressOf PopupContentElement_ComponentsCreated
-End Sub
-Private Sub PopupContentElement_ComponentsCreated(ByVal sender As Object, ByVal e As EventArgs)
- For Each component As ITimeSpanPickerComponent In radTimeSpanPicker1.PopupContentElement.Components
- Dim listUiCompoinent As ListTimeSpanPickerUIComponent = TryCast(component.TimeSpanPickerUIComponent, ListTimeSpanPickerUIComponent)
- listUiCompoinent.ListElement.Tag = Me.radTimeSpanPicker1.PopupContentElement.Components.IndexOf(TryCast(component, RadItem))
- AddHandler listUiCompoinent.ListElement.VisualItemFormatting, AddressOf ListElement_VisualItemFormatting
- Next component
-End Sub
-Private Sub ListElement_VisualItemFormatting(ByVal sender As Object, ByVal args As VisualItemFormattingEventArgs)
- Dim componentIndex As Integer = CInt(Fix(args.VisualItem.Data.Owner.Tag))
- If componentIndex = 1 Then
- args.VisualItem.BackColor = ColorTranslator.FromHtml("#f5c020")
- args.VisualItem.ForeColor = ColorTranslator.FromHtml("#008de7")
- args.VisualItem.GradientStyle = GradientStyles.Solid
- Else
- args.VisualItem.ResetValue(RadListVisualItem.BackColorProperty, ValueResetFlags.Local)
- args.VisualItem.ResetValue(RadListVisualItem.GradientStyleProperty, ValueResetFlags.Local)
- args.VisualItem.ResetValue(RadListVisualItem.ForeColorProperty, ValueResetFlags.Local)
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+
Here is the result.
diff --git a/controls/editors/timespanpicker/format-string.md b/controls/editors/timespanpicker/format-string.md
index bfc0b0727..e51e3ecfa 100644
--- a/controls/editors/timespanpicker/format-string.md
+++ b/controls/editors/timespanpicker/format-string.md
@@ -16,18 +16,10 @@ If you want to add a specific content to the string you will need to enclose in
#### Using a custom format string
-{{source=..\SamplesCS\Editors\TimeSpanCode.cs region=FormatString}}
-{{source=..\SamplesVB\Editors\TimeSpanCode.vb region=FormatString}}
-````C#
-radTimeSpanPicker1.Format = "dd\'days \'hh\'hours \'mm\'minutes \'ss\'seconds \'fff\'milliseconds\'";
+
+
-````
-````VB.NET
-radTimeSpanPicker1.Format = "dd'days 'hh'hours 'mm'minutes 'ss'seconds 'fff'milliseconds'"
-````
-
-{{endregion}}
You can find in the screenshot below the obtained result.
diff --git a/controls/editors/timespanpicker/getting-started.md b/controls/editors/timespanpicker/getting-started.md
index 77a3b1b04..964902954 100644
--- a/controls/editors/timespanpicker/getting-started.md
+++ b/controls/editors/timespanpicker/getting-started.md
@@ -42,18 +42,10 @@ This topic will walk you through the process of creating of __RadTimeSpanPicker_
2\. In the code behind set the value of the control.
-{{source=..\SamplesCS\Editors\TimeSpanCode.cs region=getting-started}}
-{{source=..\SamplesVB\Editors\TimeSpanCode.vb region=getting-started}}
-````C#
-this.radTimeSpanPicker1.Value = TimeSpan.FromDays(5);
+
+
-````
-````VB.NET
-Me.radTimeSpanPicker1.Value = TimeSpan.FromDays(5)
-````
-
-{{endregion}}
3\. You can start the application and enter a new value.
diff --git a/controls/editors/timespanpicker/localization.md b/controls/editors/timespanpicker/localization.md
index b187662b8..461f68106 100644
--- a/controls/editors/timespanpicker/localization.md
+++ b/controls/editors/timespanpicker/localization.md
@@ -21,70 +21,14 @@ To localize __RadTimeSpanPicker__ to display any text and messages in a specific
Below is a sample implementation of an English localization provider:
-{{source=..\SamplesCS\Editors\TimeSpanCode.cs region=Localization}}
-{{source=..\SamplesVB\Editors\TimeSpanCode.vb region=Localization}}
-````C#
-class MyRadTimeSpanPickerLocalizationProvider : RadTimeSpanPickerLocalizationProvider
-{
- public override string GetLocalizedString(string id)
- {
- switch (id)
- {
- case RadTimeSpanPickerStringId.NullText: return "Select time span";
- case RadTimeSpanPickerStringId.DaysText: return "Days";
- case RadTimeSpanPickerStringId.HoursText: return "Hours";
- case RadTimeSpanPickerStringId.MinutesText: return "Minutes";
- case RadTimeSpanPickerStringId.SecondsText: return "Seconds";
- case RadTimeSpanPickerStringId.MillisecondsText: return "Milliseconds";
- case RadTimeSpanPickerStringId.CloseButtonText: return "Close";
- }
- return base.GetLocalizedString(id);
- }
-}
+
+
-````
-````VB.NET
-Friend Class MyRadTimeSpanPickerLocalizationProvider
- Inherits RadTimeSpanPickerLocalizationProvider
- Public Overrides Function GetLocalizedString(ByVal id As String) As String
- Select Case id
- Case RadTimeSpanPickerStringId.NullText
- Return "Select time span"
- Case RadTimeSpanPickerStringId.DaysText
- Return "Days"
- Case RadTimeSpanPickerStringId.HoursText
- Return "Hours"
- Case RadTimeSpanPickerStringId.MinutesText
- Return "Minutes"
- Case RadTimeSpanPickerStringId.SecondsText
- Return "Seconds"
- Case RadTimeSpanPickerStringId.MillisecondsText
- Return "Milliseconds"
- Case RadTimeSpanPickerStringId.CloseButtonText
- Return "Close"
- End Select
- Return MyBase.GetLocalizedString(id)
- End Function
-End Class
-````
-
-{{endregion}}
To apply the custom localization provider, instantiate and assign it to the current localization provider:
#### Assigning the Current Localization Provider
-{{source=..\SamplesCS\Editors\TimeSpanCode.cs region=ChangeProvider}}
-{{source=..\SamplesVB\Editors\TimeSpanCode.vb region=ChangeProvider}}
-````C#
-RadTimeSpanPickerLocalizationProvider.CurrentProvider = new MyRadTimeSpanPickerLocalizationProvider();
-
-````
-````VB.NET
-RadTimeSpanPickerLocalizationProvider.CurrentProvider = New MyRadTimeSpanPickerLocalizationProvider()
-
-````
-
-{{endregion}}
-
+
+
\ No newline at end of file
diff --git a/controls/file-dialogs/dialog-controls/radopenfiledialog.md b/controls/file-dialogs/dialog-controls/radopenfiledialog.md
index 6ccd1e78a..04c4d4c1d 100644
--- a/controls/file-dialogs/dialog-controls/radopenfiledialog.md
+++ b/controls/file-dialogs/dialog-controls/radopenfiledialog.md
@@ -25,31 +25,10 @@ To show the dialog call its **ShowDialog** method. If a valid file is opened whe
#### Example 1: Show an open file dialog
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=OpenFileDialogExample}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=OpenFileDialogExample}}
+
+
-````C#
-RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
-DialogResult dr = openFileDialog.ShowDialog();
-if (dr == System.Windows.Forms.DialogResult.OK)
-{
- string fileName = openFileDialog.FileName;
-}
-
-````
-````VB.NET
-
-Dim openFileDialog As RadOpenFileDialog = New RadOpenFileDialog()
-Dim dr As DialogResult = openFileDialog.ShowDialog()
-
-If dr = System.Windows.Forms.DialogResult.OK Then
- Dim fileName As String = openFileDialog.FileName
-End If
-
-````
-
-{{endregion}}
## Opening the Selected File
@@ -57,31 +36,10 @@ You can open a read-only file stream for the selected file using the OpenFile me
#### Example 2: Open a file stream
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=OpenFileStreamExample}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=OpenFileStreamExample}}
-
-````C#
-
-RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
-DialogResult dr = openFileDialog.ShowDialog();
-if (dr == System.Windows.Forms.DialogResult.OK)
-{
- Stream fileStream = openFileDialog.OpenFile();
-}
-
-````
-````VB.NET
-
-Dim openFileDialog As RadOpenFileDialog = New RadOpenFileDialog()
-Dim dr As DialogResult = openFileDialog.ShowDialog()
+
+
-If dr = System.Windows.Forms.DialogResult.OK Then
- Dim fileStream As Stream = openFileDialog.OpenFile()
-End If
-````
-
-{{endregion}}
## Enabling Multiple Selection
@@ -89,24 +47,10 @@ The dialog supports single and multiple selection modes. By default, you can sel
#### Example 3: Enable multiple selection
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=MultipleSelectionExample}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=MultipleSelectionExample}}
-
-````C#
-
-RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
-openFileDialog.MultiSelect = true;
-
-````
-````VB.NET
-
-Dim openFileDialog As RadOpenFileDialog = New RadOpenFileDialog()
-openFileDialog.MultiSelect = True
+
+
-````
-
-{{endregion}}
>caption Figure 2: Multiple selection
@@ -121,39 +65,10 @@ You can get only the name of the selected files, without the full path, via the
#### Example 4: Get the selected file names
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=SelectedFileNames}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=SelectedFileNames}}
-
-````C#
-
-RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
-openFileDialog.MultiSelect = true;
-DialogResult dr = openFileDialog.ShowDialog();
-if (dr == System.Windows.Forms.DialogResult.OK)
-{
- string filePath = openFileDialog.FileName;
- IEnumerable filePaths = openFileDialog.FileNames;
- IEnumerable fileNames = openFileDialog.SafeFileNames;
-}
-
+
+
-````
-````VB.NET
-Dim openFileDialog As RadOpenFileDialog = New RadOpenFileDialog()
-openFileDialog.MultiSelect = True
-Dim dr As DialogResult = openFileDialog.ShowDialog()
-
-If dr = System.Windows.Forms.DialogResult.OK Then
- Dim filePath As String = openFileDialog.FileName
- Dim filePaths As IEnumerable(Of String) = openFileDialog.FileNames
- Dim fileNames As IEnumerable(Of String) = openFileDialog.SafeFileNames
-End If
-
-
-````
-
-{{endregion}}
The **FileName** property can be set manually. This will change the value displayed in the selected file auto-complete box area. Note that setting this won't change the selected item in the list with the files.
@@ -163,23 +78,10 @@ You can save the last used directory by setting the **RestoreDirectory** propert
#### Example 5: Set RestoreDirectory property
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=RestoreDirectoryPropertyExample}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=RestoreDirectoryPropertyExample}}
-
-````C#
+
+
-RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
-openFileDialog.RestoreDirectory = true;
-````
-````VB.NET
-
-Dim openFileDialog As RadOpenFileDialog = New RadOpenFileDialog()
-openFileDialog.RestoreDirectory = True
-
-````
-
-{{endregion}}
>important Note that the directory restoring feature works per dialog instance and only in memory. This means that the previously selected directory will be stored in a private string field of the RadOpenFolderDialog instance. In other words, to use the feature the following requirements should be met:
* The same dialog instance should be used every time you open the dialog.
@@ -192,27 +94,10 @@ You can display a checkbox to control whether the file should be opened in reado
#### Example 6: Enabling the ReadOnly CheckBox
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=EnablingReadOnlyCheckBoxExample}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=EnablingReadOnlyCheckBoxExample}}
-
-````C#
+
+
-RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
-openFileDialog.ShowReadOnly = true;
-openFileDialog.ReadOnlyChecked = true;
-DialogResult dr = openFileDialog.ShowDialog();
-````
-````VB.NET
-
-Dim openFileDialog As RadOpenFileDialog = New RadOpenFileDialog()
-openFileDialog.ShowReadOnly = True
-openFileDialog.ReadOnlyChecked = True
-Dim dr As DialogResult = openFileDialog.ShowDialog()
-
-````
-
-{{endregion}}
>caption Figure 3: RadOpenFileDialog with Checked ReadOnly CheckBox
@@ -224,37 +109,10 @@ Dim dr As DialogResult = openFileDialog.ShowDialog()
#### Example 7: Using the DereferenceLinks property
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=UsingDereferenceLinksPropertyExample}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=UsingDereferenceLinksPropertyExample}}
-
-````C#
-
-RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
-openFileDialog.DereferenceLinks = true;
-DialogResult dr = openFileDialog.ShowDialog();
-if (dr == System.Windows.Forms.DialogResult.OK)
-{
- string filePath = openFileDialog.FileName;
- // If the selected file was C:\Users\\Desktop\Shortcut.lnk, for example,
- // the FileName property will now contain the actual location of the file,
- // for example - C:\Program Files\Program\Shortcut.exe.
-}
-
-
-````
-````VB.NET
-
- Dim openFileDialog As RadOpenFileDialog = New RadOpenFileDialog()
- openFileDialog.DereferenceLinks = True
- Dim dr As DialogResult = openFileDialog.ShowDialog()
-
- If dr = System.Windows.Forms.DialogResult.OK Then
- Dim filePath As String = openFileDialog.FileName
- End If
+
+
-````
-{{endregion}}
>important If in multiple or single selection the first selected item is a link to a directory and **DereferenceLinks** is set to *True*, clicking the `Open` button will actually navigate to this directory.
diff --git a/controls/file-dialogs/dialog-controls/radopenfolderdialog.md b/controls/file-dialogs/dialog-controls/radopenfolderdialog.md
index 0b9e3e32e..96de51098 100644
--- a/controls/file-dialogs/dialog-controls/radopenfolderdialog.md
+++ b/controls/file-dialogs/dialog-controls/radopenfolderdialog.md
@@ -24,32 +24,10 @@ To show the dialog call its **ShowDialog** method. If a valid folder is opened w
#### Example 1: Show a open folder dialog
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=OpenFolderDialogExample}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=OpenFolderDialogExample}}
+
+
-````C#
-RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();
-DialogResult dr = openFolderDialog.ShowDialog();
-if (dr == System.Windows.Forms.DialogResult.OK)
-{
- string folderName = openFolderDialog.FileName;
-}
-
-
-````
-````VB.NET
-
-Dim openFolderDialog As RadOpenFolderDialog = New RadOpenFolderDialog()
-Dim dr As DialogResult = openFolderDialog.ShowDialog()
-
-If dr = System.Windows.Forms.DialogResult.OK Then
- Dim folderName As String = openFolderDialog.FileName
-End If
-
-````
-
-{{endregion}}
## Enabling Multiple Selection
@@ -57,23 +35,10 @@ The dialog supports single and multiple selection modes. By default, you can sel
#### Example 2: Multiple selection
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=MultipleSelection}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=MultipleSelection}}
-
-````C#
-
-RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();
-openFolderDialog.Multiselect = true;
-
-````
-````VB.NET
-
-Dim openFolderDialog As RadOpenFolderDialog = New RadOpenFolderDialog()
-openFolderDialog.Multiselect = True
+
+
-````
-{{endregion}}
>caption Figure 2: Multiple Selection
@@ -87,38 +52,10 @@ You can get only the name of the selected folders, without the full path, via th
#### Example 3: Get the selected folder names
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=SelectedFolderNames}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=SelectedFolderNames}}
+
+
-````C#
-RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();
-openFolderDialog.Multiselect = true;
-DialogResult dr = openFolderDialog.ShowDialog();
-if (dr == System.Windows.Forms.DialogResult.OK)
-{
- string folderPath = openFolderDialog.FileName;
- IEnumerable folderPaths = openFolderDialog.FileNames;
- IEnumerable folderNames = openFolderDialog.SafeFileNames;
-}
-
-
-````
-````VB.NET
-
-Dim openFolderDialog As RadOpenFolderDialog = New RadOpenFolderDialog()
-openFolderDialog.Multiselect = True
-Dim dr As DialogResult = openFolderDialog.ShowDialog()
-
-If dr = System.Windows.Forms.DialogResult.OK Then
- Dim folderPath As String = openFolderDialog.FileName
- Dim folderPaths As IEnumerable(Of String) = openFolderDialog.FileNames
- Dim folderNames As IEnumerable(Of String) = openFolderDialog.SafeFileNames
-End If
-
-````
-
-{{endregion}}
## Saving the Last Used Directory
@@ -126,23 +63,10 @@ You can save the last used directory by setting the **RestoreDirectory** propert
#### Example 4: Set RestoreDirectory property
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=RestoreDirectoryProperty}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=RestoreDirectoryProperty}}
-
-````C#
-
-RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();
-openFolderDialog.RestoreDirectory = true;
-
-````
-````VB.NET
-
-Dim openFolderDialog As RadOpenFolderDialog = New RadOpenFolderDialog()
-openFolderDialog.RestoreDirectory = True
+
+
-````
-{{endregion}}
After setting this property to *True* and opening a folder the **InitialDirectory** of this **RadOpenFolderDialog** instance will be set to the parent of the opened folder.
diff --git a/controls/file-dialogs/dialog-controls/radsavefiledialog.md b/controls/file-dialogs/dialog-controls/radsavefiledialog.md
index 56557cc24..b5491617e 100644
--- a/controls/file-dialogs/dialog-controls/radsavefiledialog.md
+++ b/controls/file-dialogs/dialog-controls/radsavefiledialog.md
@@ -25,31 +25,10 @@ To show the dialog call its **ShowDialog** method. If a valid file is selected w
#### Example 1: Show a save file dialog
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=SaveFileDialogExample}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=SaveFileDialogExample}}
+
+
-````C#
-RadSaveFileDialog saveFileDialog = new RadSaveFileDialog();
-DialogResult dr = saveFileDialog.ShowDialog();
-if (dr == System.Windows.Forms.DialogResult.OK)
-{
- string selectedFileName = saveFileDialog.FileName;
-}
-
-````
-````VB.NET
-
-Dim saveFileDialog As RadSaveFileDialog = New RadSaveFileDialog()
-Dim dr As DialogResult = saveFileDialog.ShowDialog()
-
-If dr = System.Windows.Forms.DialogResult.OK Then
- Dim selectedFileName As String = saveFileDialog.FileName
-End If
-
-````
-
-{{endregion}}
## Creating a stream for the selected file
@@ -57,30 +36,10 @@ You can open a read-write file stream for the selected file using the **OpenFile
#### Example 2: Open a file stream
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=OpenFileStreamExample}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=OpenFileStreamExample}}
-
-````C#
+
+
-RadSaveFileDialog saveFileDialog = new RadSaveFileDialog();
-DialogResult dr = saveFileDialog.ShowDialog();
-if (dr == System.Windows.Forms.DialogResult.OK)
-{
- Stream fileStream = saveFileDialog.OpenFile();
-}
-````
-````VB.NET
-
-Dim saveFileDialog As RadSaveFileDialog = New RadSaveFileDialog()
-Dim dr As DialogResult = saveFileDialog.ShowDialog()
-If dr = System.Windows.Forms.DialogResult.OK Then
- Dim fileStream As Stream = saveFileDialog.OpenFile()
-End If
-
-````
-
-{{endregion}}
## Working with the selected file
@@ -90,26 +49,10 @@ The **FileName** property can be set manually. This will change the value displa
#### Example 3: Set the file name
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=SetFileNameExample}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=SetFileNameExample}}
-
-````C#
-RadSaveFileDialog saveFileDialog = new RadSaveFileDialog();
-saveFileDialog.InitialDirectory = @"C:\Program Files\Internet Explorer\";
-saveFileDialog.FileName = @"C:\Program Files\Internet Explorer\iexplore.exe";
-DialogResult dr = saveFileDialog.ShowDialog();
-
-````
-````VB.NET
-
-Dim saveFileDialog As RadSaveFileDialog = New RadSaveFileDialog()
-saveFileDialog.InitialDirectory = "C:\Program Files\Internet Explorer\"
-saveFileDialog.FileName = "C:\Program Files\Internet Explorer\iexplore.exe"
-Dim dr As DialogResult = saveFileDialog.ShowDialog()
+
+
-````
-{{endregion}}
>caption Figure 2: Setting the File Name
diff --git a/controls/file-dialogs/features/context-menu.md b/controls/file-dialogs/features/context-menu.md
index 05d041a70..5cef37fa5 100644
--- a/controls/file-dialogs/features/context-menu.md
+++ b/controls/file-dialogs/features/context-menu.md
@@ -21,44 +21,8 @@ The **ShellContextMenuOpening** event occurs when the context menu is about to o
#### Modify ShellContextMenu
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=Menu}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=Menu}}
+
+
-````C#
- private void RadForm_Load(object sender, EventArgs e)
- {
- RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();
- openFolderDialog.OpenFolderDialogForm.ExplorerControl.ShellContextMenuOpening += ExplorerControl_ShellContextMenuOpening;
- }
- private void ExplorerControl_ShellContextMenuOpening(object sender, Telerik.WinControls.FileDialogs.ContextMenuOpeningEventArgs e)
- {
- e.Cancel = true;
-
- if (e.IsOpeningOnEmptySpace)
- {
- e.Cancel = false;
- e.ShortContextMenuOptions = ShortContextMenuOptions.NewFolder | ShortContextMenuOptions.View;
- }
- }
-
-````
-````VB.NET
- Private Sub RadForm_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
- Dim openFolderDialog As RadOpenFolderDialog = New RadOpenFolderDialog()
- AddHandler openFolderDialog.OpenFolderDialogForm.ExplorerControl.ShellContextMenuOpening, AddressOf ExplorerControl_ShellContextMenuOpening
- End Sub
-
- Private Sub ExplorerControl_ShellContextMenuOpening(ByVal sender As Object, ByVal e As Telerik.WinControls.FileDialogs.ContextMenuOpeningEventArgs)
- e.Cancel = True
-
- If e.IsOpeningOnEmptySpace Then
- e.Cancel = False
- e.ShortContextMenuOptions = ShortContextMenuOptions.NewFolder Or ShortContextMenuOptions.View
- End If
- End Sub
-
-````
-
-{{endregion}}
diff --git a/controls/file-dialogs/features/editing-options.md b/controls/file-dialogs/features/editing-options.md
index 4b3ca0751..af167b626 100644
--- a/controls/file-dialogs/features/editing-options.md
+++ b/controls/file-dialogs/features/editing-options.md
@@ -30,88 +30,28 @@ The available **EditingOptions** are listed below:
#### Set multiple EditinOptions limitations
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=Limit}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=Limit}}
+
+
-````C#
- RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();
- openFolderDialog.EditingOptions = Telerik.WinControls.FileDialogs.EditingOptions.All;
- openFolderDialog.EditingOptions ^= (EditingOptions.NewFolder | EditingOptions.Rename);
- openFolderDialog.ShowDialog();
-````
-````VB.NET
- Dim openFolderDialog As RadOpenFolderDialog = New RadOpenFolderDialog()
- openFolderDialog.EditingOptions = Telerik.WinControls.FileDialogs.EditingOptions.All
- openFolderDialog.EditingOptions = openFolderDialog.EditingOptions Xor (EditingOptions.NewFolder Or EditingOptions.Rename)
- openFolderDialog.ShowDialog()
-
-````
-
-{{endregion}}
Even though you specify the **EditingOptions**, the end-user is still allowed to drag and drop the files. If you want to disable drag and drop operations you should set explicitly the **IsDragDropEnabled** property of the **ExplorerControl** to *false*.
#### Disable drag and drop operations
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=DisableDragDrop}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=DisableDragDrop}}
-
-````C#
- openFolderDialog.OpenFolderDialogForm.ExplorerControl.IsDragDropEnabled = false;
+
+
-````
-````VB.NET
- openFolderDialog.OpenFolderDialogForm.ExplorerControl.IsDragDropEnabled = False
-````
-
-{{endregion}}
You cannot modify files/folders context menu but you can choose to cancel its opening. You can, however, modify the empty space context menu items as follows:
#### Modify ShellContextMenu
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=Menu}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=Menu}}
-
-````C#
- private void RadForm_Load(object sender, EventArgs e)
- {
- RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();
- openFolderDialog.OpenFolderDialogForm.ExplorerControl.ShellContextMenuOpening += ExplorerControl_ShellContextMenuOpening;
- }
-
- private void ExplorerControl_ShellContextMenuOpening(object sender, Telerik.WinControls.FileDialogs.ContextMenuOpeningEventArgs e)
- {
- e.Cancel = true;
-
- if (e.IsOpeningOnEmptySpace)
- {
- e.Cancel = false;
- e.ShortContextMenuOptions = ShortContextMenuOptions.NewFolder | ShortContextMenuOptions.View;
- }
- }
-
-````
-````VB.NET
- Private Sub RadForm_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
- Dim openFolderDialog As RadOpenFolderDialog = New RadOpenFolderDialog()
- AddHandler openFolderDialog.OpenFolderDialogForm.ExplorerControl.ShellContextMenuOpening, AddressOf ExplorerControl_ShellContextMenuOpening
- End Sub
-
- Private Sub ExplorerControl_ShellContextMenuOpening(ByVal sender As Object, ByVal e As Telerik.WinControls.FileDialogs.ContextMenuOpeningEventArgs)
- e.Cancel = True
-
- If e.IsOpeningOnEmptySpace Then
- e.Cancel = False
- e.ShortContextMenuOptions = ShortContextMenuOptions.NewFolder Or ShortContextMenuOptions.View
- End If
- End Sub
-
-````
-
-{{endregion}}
+
+
+
+
diff --git a/controls/file-dialogs/getting-started.md b/controls/file-dialogs/getting-started.md
index f5f0d6e24..6c406e7b9 100644
--- a/controls/file-dialogs/getting-started.md
+++ b/controls/file-dialogs/getting-started.md
@@ -41,83 +41,10 @@ The following tutorial demonstrates how to specify a file name by using a **RadS
#### How to use the file dialogs
-{{source=..\SamplesCS\FileDialogs\FileDialogsEditingOptions.cs region=GettingStartedExample}}
-{{source=..\SamplesVB\FileDialogs\FileDialogsEditingOptions.vb region=GettingStartedExample}}
-
-````C#
-
- private void radButton1_Click(object sender, EventArgs e)
- {
- RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();
- openFolderDialog.ShowDialog();
- if (openFolderDialog.OpenFolderDialogForm.DialogResult == System.Windows.Forms.DialogResult.OK)
- {
- string folderName = openFolderDialog.FileName;
- this.radLabel1.Text = folderName;
- }
- }
-
- private void radButton2_Click(object sender, EventArgs e)
- {
- RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
- openFileDialog.ShowDialog();
-
- if (openFileDialog.OpenFileDialogForm.DialogResult == System.Windows.Forms.DialogResult.OK)
- {
- string fileName = openFileDialog.FileName;
- this.radLabel2.Text = fileName;
- }
- }
-
- private void radButton3_Click(object sender, EventArgs e)
- {
- RadSaveFileDialog saveFileDialog = new RadSaveFileDialog();
- saveFileDialog.ShowDialog();
- if (saveFileDialog.SaveFileDialogForm.DialogResult == System.Windows.Forms.DialogResult.OK)
- {
- string selectedFileName = saveFileDialog.FileName;
- this.radLabel3.Text = selectedFileName;
- }
- }
-
-
-````
-````VB.NET
-
- Private Sub radButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
- Dim openFolderDialog As RadOpenFolderDialog = New RadOpenFolderDialog()
- openFolderDialog.ShowDialog()
-
- If openFolderDialog.OpenFolderDialogForm.DialogResult = System.Windows.Forms.DialogResult.OK Then
- Dim folderName As String = openFolderDialog.FileName
- Me.radLabel1.Text = folderName
- End If
- End Sub
-
- Private Sub radButton2_Click(ByVal sender As Object, ByVal e As EventArgs)
- Dim openFileDialog As RadOpenFileDialog = New RadOpenFileDialog()
- openFileDialog.ShowDialog()
-
- If openFileDialog.OpenFileDialogForm.DialogResult = System.Windows.Forms.DialogResult.OK Then
- Dim fileName As String = openFileDialog.FileName
- Me.radLabel2.Text = fileName
- End If
- End Sub
-
- Private Sub radButton3_Click(ByVal sender As Object, ByVal e As EventArgs)
- Dim saveFileDialog As RadSaveFileDialog = New RadSaveFileDialog()
- saveFileDialog.ShowDialog()
-
- If saveFileDialog.SaveFileDialogForm.DialogResult = System.Windows.Forms.DialogResult.OK Then
- Dim selectedFileName As String = saveFileDialog.FileName
- Me.radLabel3.Text = selectedFileName
- End If
- End Sub
-
-
-````
-
-{{endregion}}
+
+
+
+
This is it! Now you can select a file name or open a folder.
diff --git a/controls/filter-view/filter-view-changing-default-editors.md b/controls/filter-view/filter-view-changing-default-editors.md
index 968131122..ba14d4e3d 100644
--- a/controls/filter-view/filter-view-changing-default-editors.md
+++ b/controls/filter-view/filter-view-changing-default-editors.md
@@ -29,37 +29,10 @@ For the boolean fields in the applied DataSource, **RadFilterView** generates a
The **CategoryCreating** event gives you the possibility to replace the default **FilterViewBooleanCategoryElement** with another one, e.g. **FilterViewTextCategoryElement** with radio buttons:
-{{source=..\SamplesCS\FilterView\FilterViewGettingStarted.cs region=ReplaceCategory}}
-{{source=..\SamplesVB\FilterView\FilterViewGettingStarted.vb region=ReplaceCategory}}
-
-````C#
-
-private void RadFilterView_CategoryCreating(object sender, FilterViewCategoryCreatingEventArgs e)
-{
- if (e.Category.PropertyName == "Discontinued")
- {
- FilterViewTextCategoryElement textCategory = new FilterViewTextCategoryElement();
- textCategory.PropertyName = e.Category.PropertyName;
- textCategory.ItemType = FilterViewTextCategoryItemType.RadioButton;
- e.Category = textCategory;
- }
-}
-
-````
-````VB.NET
-
-Private Sub RadFilterView_CategoryCreating(ByVal sender As Object, ByVal e As FilterViewCategoryCreatingEventArgs)
- If e.Category.PropertyName = "Discontinued" Then
- Dim textCategory As FilterViewTextCategoryElement = New FilterViewTextCategoryElement()
- textCategory.PropertyName = e.Category.PropertyName
- textCategory.ItemType = FilterViewTextCategoryItemType.RadioButton
- e.Category = textCategory
- End If
-End Sub
-
-````
-
-{{endregion}}
+
+
+
+

@@ -67,33 +40,10 @@ End Sub
By default, the **FilterViewTextCategoryElement** auto-generates a set of check boxes for each string value. You can switch to creating a set of radio buttons and thus allowing only a single text value to be selected:
-{{source=..\SamplesCS\FilterView\FilterViewGettingStarted.cs region=SwitchToRadioButtons}}
-{{source=..\SamplesVB\FilterView\FilterViewGettingStarted.vb region=SwitchToRadioButtons}}
-
-````C#
-
-private void RadFilterView1_CategoryCreating(object sender, FilterViewCategoryCreatingEventArgs e)
-{
- if (e.Category.PropertyName == "ProductName")
- {
- FilterViewTextCategoryElement textCategory = e.Category as FilterViewTextCategoryElement;
- textCategory.ItemType = FilterViewTextCategoryItemType.RadioButton;
- }
-}
-
-````
-````VB.NET
-
-Private Sub RadFilterView1_CategoryCreating(ByVal sender As Object, ByVal e As FilterViewCategoryCreatingEventArgs)
- If e.Category.PropertyName = "ProductName" Then
- Dim textCategory As FilterViewTextCategoryElement = TryCast(e.Category, FilterViewTextCategoryElement)
- textCategory.ItemType = FilterViewTextCategoryItemType.RadioButton
- End If
-End Sub
+
+
-````
-{{endregion}}

@@ -107,223 +57,17 @@ You may want to replace them with two **RadCalendar** controls. The following ex

-{{source=..\SamplesCS\FilterView\FilterViewGettingStarted.cs region=CalendarCategory}}
-{{source=..\SamplesVB\FilterView\FilterViewGettingStarted.vb region=CalendarCategory}}
-
-````C#
-public class FilterViewCalendarCategoryElement : FilterViewDateTimeCategoryElement
-{
-
- RadCalendar minValueCalendar;
- RadCalendar maxValueCalendar;
-
- public FilterViewCalendarCategoryElement(string propertyName) : base(propertyName)
- {
-
- }
-
- protected override void CreateChildElements()
- {
- base.CreateChildElements();
- this.MinValueDateTimePicker.Visibility = ElementVisibility.Collapsed;
- this.MaxValueDateTimePicker.Visibility = ElementVisibility.Collapsed;
- this.minValueCalendar = new RadCalendar();
- minValueCalendar.AllowMultipleSelect = false;
- this.minValueCalendar.SelectedDate = this.minValue;
- RadHostItem minHost = new RadHostItem(this.minValueCalendar);
- minHost.MinSize = new Size(0, 150);
- this.minValueCalendar.SelectionChanged += Calendar_SelectionChanged;
- this.minValueCalendar.Margin = new Padding(2);
- this.EditorsStack.Children.Insert(1, minHost);
- this.minValueCalendar.SelectedDate = this.minValue;
-
- this.maxValueCalendar = new RadCalendar();
- maxValueCalendar.AllowMultipleSelect = false;
- this.maxValueCalendar.SelectedDate = this.maxValue;
- this.maxValueCalendar.SelectionChanged += Calendar_SelectionChanged;
- RadHostItem maxHost = new RadHostItem(this.maxValueCalendar);
- maxHost.MinSize = new Size(0, 150);
- maxHost.StretchHorizontally = true;
- this.maxValueCalendar.Margin = new Padding(2);
- this.EditorsStack.Children.Add(maxHost);
- }
-
- protected override void DisposeManagedResources()
- {
- base.DisposeManagedResources();
- this.minValueCalendar.SelectionChanged -= Calendar_SelectionChanged;
- this.maxValueCalendar.SelectionChanged -= Calendar_SelectionChanged;
- }
- public override void CreateItems(ICollection