I have already managed to add a Help Button to my BaseForm (see attached image).
I would love to have the same little help icon with the Click handler added just before the Scroll Buttons on the RadPageView Strip Element.
Here is the code for the Help Button:
RadButtonElement _btnHelp = new RadButtonElement();
_btnHelp.ShowBorder = false;
_btnHelp.Image = global::labs.STAR.App.Properties.Resources.helpicon;
_btnHelp.ClickMode = ClickMode.Press;
_btnHelp.Click += _btnHelp_Click;
this.FormElement.TitleBar.SystemButtons.Children.Insert(0, _btnHelp);
thx in advance,
Darko
7 Answers, 1 is accepted
Thank you for writing.
You can add a help button next to the strip buttons in the RadPageView by using the following code snippet:
public
Form1()
{
InitializeComponent();
RadPageViewStripElement stripElement =
this
.radPageView1.ViewElement
as
RadPageViewStripElement;
RadPageViewStripButtonElement infoButton =
new
RadPageViewStripButtonElement();
infoButton.Image = Properties.Resources.info;
stripElement.ItemContainer.ButtonsPanel.Children.Insert(0, infoButton);
infoButton.Click += infoButton_Click;
}
private
void
infoButton_Click(
object
sender, EventArgs e)
{
RadMessageBox.Show(
"Clicked"
);
}
I hope this information helps. Should you have further questions, I would be glad to help.
Regards,
Desislava
Telerik
The size of my newly added buttonElement is smaller than the sizes of item buttons such as the scroll and close buttons in the strip. How do I set the size of my newly added buttonElement to the size of other item buttons so that all buttons in the strip have the same size?
Thank you.
Hello, Swaroop,
You can use the ButtonsSize property which applies the same size to each of the embedded buttons:
RadPageViewStripElement stripElement = this.radPageView1.ViewElement as RadPageViewStripElement;
stripElement.ItemContainer.ButtonsPanel.ButtonsSize = new Size(26, 26);
In the following picture, you can see that all the buttons, including the new one, are the same size.
I hope this helps. If you have other questions please let me know.
Regards,
Nadya
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).
Thanks, I appreciate your help.
One more question, How do I get the size of the scroll button or the TabClose button in the tabstrip. I want to get those sizes so that I can set the close button's size or the scroll button's size as the new button's size.
Thanks.
Ok I've solved it.
I can set the close button's size as the size of my new button using the below code.
stripElement.ItemContainer.ButtonsPanel.ButtonSize = stripElement.ItemContainer.ButtonsPanel.CloseButton.Size