Telerik & Dev Notes
http://www.telerik.com/help/winforms/ribbonbar-overview.html
http://www.telerik.com/community/forums/winforms/ribbonbar.aspx
Video: Overview Video
With the RadRibbonBar control you can build user interfaces similar to those used in Microsoft Office.
Consider adding a RadRibbonForm to the Solution rather than adding a RadRibbonBar to a regular RadForm.
RadRibbonTab – rrbt
RadRibbonBarGroup – rrbg
<ul>
<li>> <p>‘Items’ collection defines ‘RadMenuItems’ (controls - buttons, etc) or ‘RadRibbonBarButtonGroup’ containers which include a border and allow vertical orientation.</p>
</li>
<li>> <p>Set Buttons for AutoSize = False, TextWrap = True and set Size/Width = narrower so the text will wrap</p>
</li>
<li>> <p>I’m not sure how to center buttons in a group when the group name is wider than the list of buttons.</p>
</li></ul>
RadRibbonBarButtonGroup – rrbbg
RadButtonElement - rbe - Position text to BottomCenter, enable TextWrap and config an icon
Hide elements of the Ribbon Bar
Add the following code right under ‘InitializeComponent();’ in frmMain() (or whatever the form is called).
// Stick this right after “InitializeComponent();” on the form
// Hide the AppButton (Office Start button or 'File' tab) on the RadRibbonBar
radRibbonBar1.RibbonBarElement.ApplicationButtonElement.Visibility = Telerik.WinControls.ElementVisibility.Hidden;
// Hide the QAT (Quick Access Toolbar) on the RadRibbonBar
radRibbonBar1.RibbonBarElement.QuickAccessToolBar.Visibility = Telerik.WinControls.ElementVisibility.Hidden;
//Hide Title Bar - collapse all 3 elements to hide this bar
richTextEditorRibbonBar.RibbonBarElement.QuickAccessToolBar.Visibility = ElementVisibility.Collapsed;
richTextEditorRibbonBar.RibbonBarElement.ApplicationButtonElement.Visibility = ElementVisibility.Collapsed;
richTextEditorRibbonBar.RibbonBarElement.RibbonCaption.Visibility = ElementVisibility.Collapsed;
// Hide any RibbonBar tab with 'Name' = “Hidden” or where 'Text' contains “Hidden” (just the tab, not content)
foreach (Telerik.WinControls.UI.RibbonTab item in radRibbonBar1.CommandTabs) {
if (item.Text.ToLower().Contains(“hidden”) == true || item.Name.ToLower().Contains(“hidden”) == true)
item.Visibility = Telerik.WinControls.ElementVisibility.Hidden; // sometimes ‘Collapsed’
}
// Shift Tab Groups to the left when the AppButton (Office Start button or 'File' tab) is collapsed
radRibbonBar1.RibbonBarElement.ApplicationButtonElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
Padding p = radRibbonBar1.RibbonBarElement.TabStripElement.ItemContainer.Padding;
radRibbonBar1.RibbonBarElement.TabStripElement.ItemContainer.Padding = new Padding(0, p.Top, p.Right, p.Bottom);
// Hide the ‘ribbonTab1’ tab on the RadRibbonBar
ribbonTab1.Visibility = Telerik.WinControls.ElementVisibility.Hidden; // sometimes ‘Collapsed’
// Hide the Caret button in the upper right that collapses the RibbonBar
this.radRibbonBar1.RibbonBarElement.ExpandButton.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
// Select the 1st tab [0] on the RadRibbonBar by default
((Telerik.WinControls.UI.RibbonTab)radRibbonBar1.CommandTabs[0]).IsSelected = true;
Use the ‘Document Outline’ view (<Ctrl>+W, U) to manage a RadRibbonForm.
Managing & Reordering RibbonBar Groups
NOTE: Reordering CommandTabs in the wizard doesn’t seem to work. You can use this code instead:
//The RibbonGroups 'rrbctArchives' and 'rrbctNotes' should be in the 1st and 2nd positions from the left. Telerik support ticket: 1453535
this.richTextEditorRibbonBar.CommandTabs.Remove(this.rrbctArchives);
this.richTextEditorRibbonBar.CommandTabs.Insert(0, this.rrbctArchives);
richTextEditorRibbonBar.CommandTabs.Remove(this.rrbctNotes);
richTextEditorRibbonBar.CommandTabs.Insert(1, this.rrbctNotes);
Set default selected CommandTab
//Set Default Startup Tab
FIX
This control is not available in the RadRibbonBar Items collection, but you can add it in code.
We wanted 2 date controls followed by a dropdown list of predefined date ranges. Add the dropdown list in the designer, then insert the 2 date controls above it (top down) in code.
public frmMain()
{
InitializeComponent();
SetupRibbonFilters(); // add non-standard controls to RadRibbonBar
}
void SetupRibbonFilters()
{
AddDateTimeControl(“rdtpStartDate”);
AddDateTimeControl(“rdtpEndDate”);
}
void AddDateTimeControl(string controlName)
{
RadDateTimePicker dtPicker = new RadDateTimePicker();
dtPicker.Name = controlName;
//dtPicker.ThemeName = “Office2007Blue”; // inherits the form theme if not specified
RadHostItem hostItem = new RadHostItem(dtPicker); // placeholder
hostItem.MinSize = new Size(135, 25);
hostItem.MaxSize = new Size(150, 25);
// rrbbgDateFilter.Items.Add(hostItem); // add new control to the specified RibbonGroup
rrbbgDateFilter.Items.Insert(rrbbgDateFilter.Items.Count - 1, hostItem); // insert new control from top down
}
This control is not available in the RadRibbonBar Items collection, but you can add it in code.
public frmMain()
{
InitializeComponent();
SetupRibbonFilters(); // add non-standard controls to RadRibbonBar
}
void SetupRibbonFilters()
{
AddOtherPartyDropDown();
}
void AddOtherPartyDropDown()
{
Dictionary<int, string> other_parties = new Dictionary<int, string>(); // create sample data
other_parties.Add(0, “Joe Bob”);
other_parties.Add(1, “Jim Bob”);
other_parties.Add(2, “Bob Bob”);
other_parties.Add(3, “Leroy Bob”);
AddCheckedDropDownList(“rcddOtherParty”, “key”, “value”, other_parties);
}
void AddCheckedDropDownList(string controlName, string dataMember, string valueMember, object dataSource)
{
RadCheckedDropDownList rcddList = new RadCheckedDropDownList();
rcddList.Name = controlName;
rcddList.DataMember = dataMember;
rcddList.ValueMember = valueMember;
rcddList.DataSource = dataSource;
RadHostItem hostItem = new RadHostItem(rcddList); // placeholder
hostItem.MinSize = new Size(150, 25);
hostItem.MaxSize = new Size(150, 25);
rbgOtherParty.Items.Add(hostItem); // add new control to the specified RibbonGroup
}
http://docs.telerik.com/devtools/winforms/panorama/overview
RadPanorama is a control that displays elements of type RadTileElement in a mosaic manner. This control is inspired by the Metro Start Menu screen of Windows 8.
http://docs.telerik.com/devtools/winforms/shortcuts/shortcuts-overview
Almost each application uses the so-called “Shortcuts” – a keyboard combination that triggers a specific action. For a valid shortcut is considered any keyboard combination where a Modifier Key (Ctrl, Alt and Shift or a combination of these) is down and other key(s) is pressed. This semantic is available out-of-the-box in our framework and allows you to seamlessly plug any valid keys combination as an action accelerator. Supported are also the so-called multiple keys shortcuts where the Keys member of each shortcut may be more than one key – e.g. Ctrl + A, S is recognized by the framework. Shortcuts without modifier keys are also supported, but they should be used with caution, since they may be in conflict with other controls which intercept keyboard input.
http://www.telerik.com/help/winforms/carousel-overview.html
http://www.telerik.com/support/code-library/winforms/carousel
Video: http://www.telerik.com/videos/winforms/overview-of-radcarousel-for-winforms
http://www.telerik.com/help/winforms/clock-overview.html
http://www.telerik.com/community/forums/winforms/calendar-and-datetimepicker.aspx
VIDEO: http://tv.telerik.com/watch/winforms/getting-started-with-radtimepicker-for-winforms
NOTE: The control cannot be resized since it uses a bitmap for its background.
http://www.telerik.com/help/winforms/desktopalert-overview.html
http://www.telerik.com/community/forums/winforms/desktop-alert.aspx
http://www.telerik.com/help/winforms/desktopalert-getting-started.html
http://tv.telerik.com/watch/winforms/getting-started-with-raddesktopalert - Video- how to get started with RadDesktopAlert.
http://www.telerik.com/help/winforms/allmembers_t_telerik_wincontrols_ui_desktopalertmanager.html
VIDEO: http://www.telerik.com/videos/winforms/getting-started-with-raddesktopalert
RadDesktopAlert component displays a small pop-up window on the screen to notify the user that a specific event has occurred in the application.
My sample project: \\192.168.93.1\KB_MiM\Telerik\LS.TelerikSystrayApp
Popup notification similar to Outlook’s you have a new email Notify (Notification) popup. You can drag it around the screen. There are three buttons in the upper right to close, pin it to the screen and display a list of options.
For multi-monitor systems use the SetActiveScreen() method of the DesktopAlertManager class to set the screen where alerts display at ‘ScreenPosition’.
You can display multiple alert instances on the screen and the DesktopAlertManager will calculate the alerts’ location so that they do not overlap. Alerts are stacked on the screen in the order of their appearance. When an alert is closed, all related visible alerts are automatically relocated to utilize the screen real estate. To show multiple desktop alerts you must create a new instance for every alert. To replace an alert dispose the instance and create another new one.
int i ; // create multiple instances of the
for (i = 0; i ⇐ 2; i++)
{
RadDesktopAlert a = new RadDesktopAlert();
a.CaptionText = i.ToString();
a.Show();
}
RadDesktopAllert does not support auto-size mode. You must set the size of the control so your contents will fit.
Marcel tried this sample code in eTMsync but it didn’t work for him so he ended up writing his own resize code.
http://www.telerik.com/forums/desktop-alert-not-resizing-accordingly-to-the-contenttext-set
It offers some “HTML-like” formatting but does not support “ ”. Here is a list of supported tags and expressions.
Here’s a code example to make a clickable hyperlink in the Alert Content.
You can add a button (or other element) to any control, including an Alert. Here’s how to add a button:
RadButtonElement element = new RadButtonElement();
element.Text = “Button”;
element.MaxSize = new Size(20, 20);
this.radDesktopAlert1.Popup.AlertElement.ContentElement.Children.Add(element);
Here’s Color Change examples by choosing an alternate thems or using a customized theme from Visual Style Builder.
You can Preview the Alert in the IDE from the control Smart Tag in the Component Bin.
this.radDesktopAlert1.FixedSize = new Size(200, 200);
See: RadVScrollBar
http://www.telerik.com/help/winforms/panels-and-labels-label-overview.html
http://www.telerik.com/community/forums/winforms/panels-and-labels.aspx
Telerik themeable label with HTML-like formatting capability. Also see this video.
NOTE: Our design policy it to only change the control name from default if we will programmatically change the text.
Custom Text Formatting via MarkupEditor
http://www.telerik.com/help/winforms/panels-and-labels-label-html-like-text-formatting.html
Set these RadLabel properties and double click the label to stub out a click event.
Instead of LinkLabel see the <Links> button on the ‘MarkupEditor’ behind the ‘RadLabel.Text’ property dropdown and open locations without additional code.
<a href="http:%%//%%www.legalitysoftware.com/">Legality Software</a>
<a href=“http://www.legalitysoftware.com/”><span style=“color: #d86040”>Legality Software</span></a> - orange font in Wizards (NOTE: Set ‘BackColor’ = 225, 228, 240 to match wizard form)
<a href="http:%%//%%support.lawtopia.net/">View log files</a>
Here’s the HTML for our company blurb for wizard pages, etc. (Set ‘TextAlignment’ = MiddleCenter):
<p><span style=“font-size: 10pt; color: #00467f”><em>Legality Software provides packaged software products and custom software solutions for law firms. Our solutions typically enhance the capabilities of, or fix problems with, the tools you use in your firm today. We also help firms automate difficult, time consuming or repetitive tasks. Legality products and solutions are designed to solve your problems so you can achieve your goals. </em></span></p><p><span style=“color: #00467f”><span style=“font-size: 10pt”><em>If you have a specific problem we may already have a solution. <br /></em></span><span style=“font-size: 10pt”><em>If not we can build one for you.</em></span></span></p><p><span style=“font-size: 13px”><span style=“font-size: 10pt”><br /><span style=“color: #00467f”>Visit </span></span><a href=“http://www.legalitysoftware.com/”><span style=“font-size: 10pt”>Legality Software</span></a><span style=“font-size: 10pt; color: #00467f”> to learn more.</span></span></p>
### I DON'T KNOW HOW TO CENTER TEXT IN A MULTI-LINE LABEL
### grab code from TMFU
### grab code from TMFU & ask Larry how he worked out the issue with the Placeholder Text is not there for the 2nd replace
http://www.telerik.com/help/winforms/track-and-status-controls-progressbar-overview.html
http://www.telerik.com/community/forums/winforms/track-and-status.aspx
RadProgressBar is designed to display progress information to the user during a long-running operation.
### Need an example
http://www.telerik.com/help/winforms/track-and-status-controls-waitingbar-overview.html
http://www.telerik.com/community/forums/winforms/track-and-status.aspx
http://docs.telerik.com/devtools/winforms/track-and-status-controls/waitingbar/waitingbar
http://docs.telerik.com/devtools/winforms/track-and-status-controls/waitingbar/properties-and-methods
Like a progress bar but with no start or end. It just shows activity.
Properties
The ‘WaitingBarIndicatorElement’ is the sliding part, which has:
NOTE: A RadWaitingBar may (does) have more than 1 ‘WaitingBarIndicatorElement’, named ‘WaitingBarIndicatorElement1’ and ‘WaitingBarIndicatorElement2’ so if you use ‘ShouldPaint’, besure to change both instances.
Methods
### Add an example here from HLS PdfParser
http://docs.telerik.com/devtools/winforms/track-and-status-controls/rating/rating
RadRating is a flexible UI component that allows users to place their rating by selecting from a finite number of items (stars, diamonds and hearts). The developers can fully customize the control by configuring its orientation, rating precision, direction etc.
http://docs.telerik.com/devtools/winforms/rotator/overview
RadRotator is a multipurpose component for content rotation and personalization. Highly customizable, it delivers high interactivity and user involvement. You can display a series of images, web URLs or any collection of rad elements. Animation between frames can be opaque or transparent and the movement can be in any direction. You can adjust the level of granularity and interval between frames.
http://www.telerik.com/help/winforms/forms-and-dialogs-radtitlebar-overview.html
http://www.telerik.com/community/forums/winforms/forms-and-dialogs.aspx
RadTitleBar control is used in forms and provides functionality for dragging, minimizing, maximizing and closing the form. This control is internally used by RadForm.
To include a title bar with help, maximize, minimize and close button functionality simply drag it from the toolbox on the desired form. This control is great addition to the ShapedForm.
To customize the help, minimize, maximize and close buttons, use the RadTitleBar.TitleBarElement's HelpButton, MinimizeButton, MaximizeButton and CloseButton objects. Each button is a RadButtonElement type that include properties to control text, image, and layout.
Note: By default, the HelpButton is not shown. It is necessary to set its Visibility property to ElementVisibility.Visible in order to be displayed.
http://www.telerik.com/help/winforms/track-and-status-controls-scrollbar-overview.html
http://www.telerik.com/community/forums/winforms/track-and-status.aspx
http://www.telerik.com/help/winforms/track-and-status-controls-scrollbar-getting-started.html
Using Telerik scrollbars is a bit more intricate compared to using the standard scrollbars because you have to handle scroll event manually. Add a RadPanel to your form then add a RadVScrollbar in the panel and dock it to the Right. Add another RadPanel inside the 1st RadPanel and set its height to the total height you want to be available upon scrolling (taller than the 1st RadPanel). This value can be statics e.g. 1000 pixels or dynamic determined by the scrollable content. Now add controls (the controls which are to be scrolled) to the second RadPanel.
Then subscribe to the Scroll event of the vertical scrollbar and assign its negated value to the Top property of the second RadPanel:
void radVScrollBar1_Scroll(object sender, ScrollEventArgs e)
{
this.radPanel2.Top = -this.radVScrollBar1.Value;
}
Finally, set the Maximum property of the scrollbar to reflect the size of the scrollable height which is the total height of the scrollable content minus the visible height. For the example of this section in particular, that is the height of the second panel minus the height of the first panel.
this.radVScrollBar1.Maximum = this.radPanel2.Size.Height - this.radPanel1.Size.Height;
http://www.telerik.com/help/winforms/wizard-overview.html
http://www.telerik.com/community/forums/winforms/wizard.aspx
Design Time Settings http://www.telerik.com/help/winforms/wizard-design-time.html
Wizard dialog with multiple pages and <Back><Next> buttons.
Properties
Quick Tasks Button
Another option is to click page name in 'Pages' Collection Editor to jump/view.
### I’m not sure how to change the “Help” hyperlink in the lower left corner.
Contains the following elements:
Events - help you to follow the state of the control at run time, implement custom pages sequence and page processing validation.
http://www.telerik.com/help/winforms/wizard-events.html
Add custom/Validation functionality to Wizard Next Button
Subscribe to the Next event
this.radWizard1.Next += new WizardCancelEventHandler(radWizard1_Next);
Handle the Next event
private void radWizard1_Next(object sender, WizardCancelEventArgs e)
{
if (this.radWizard1.SelectedPage == this.radWizard1.Pages[1]) // Check if this is the desired page
{
// Do some validation here
e.Cancel = true; // If the validation does not pass
this.radWizard1.SelectedPage = this.radWizard1.Pages[0]; // Could return to 1st page
// Or you could show some message to the user
}
}
Custom Page Branching Sample Project
Custom CommandArea Controls like Navigation Buttons
Create multiple Welcome or Completion pages
RadWizardPage - rwp
Only change from default if we will programmatically change the text)