This is a migrated thread and some comments may be shown as answers.

Adding ButtonElement to the StripButtons

7 Answers 272 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Darko
Top achievements
Rank 1
Darko asked on 17 Sep 2014, 12:11 PM
Hi,

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

Sort by
0
Darko
Top achievements
Rank 1
answered on 17 Sep 2014, 12:13 PM
image was not attached....
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Sep 2014, 03:40 PM
Hello Darko,

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
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Darko
Top achievements
Rank 1
answered on 22 Sep 2014, 03:40 PM
thx a lot, that did the trick 
0
Swaroop
Top achievements
Rank 1
Veteran
answered on 17 Oct 2020, 09:22 AM

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.

0
Nadya | Tech Support Engineer
Telerik team
answered on 21 Oct 2020, 01:22 PM

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).

0
Swaroop
Top achievements
Rank 1
Veteran
answered on 25 Oct 2020, 11:03 AM

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.

0
Swaroop
Top achievements
Rank 1
Veteran
answered on 25 Oct 2020, 11:30 AM

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

Tags
PageView
Asked by
Darko
Top achievements
Rank 1
Answers by
Darko
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Swaroop
Top achievements
Rank 1
Veteran
Nadya | Tech Support Engineer
Telerik team
Share this question
or