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

Navigation Buttons

2 Answers 290 Views
Wizard
This is a migrated thread and some comments may be shown as answers.
Carl
Top achievements
Rank 1
Carl asked on 03 Oct 2011, 10:24 PM

The RadWizard has a couple of buttons by default added to the CommandArea of the RadWizard: the BackButton, the CancelButton, the FinalButton, the HelpButton, and the NextButton...

I would like to add another (custom) button (which has the look and feel of the buttons I just mentioned above / different text) which launches off a process and eventually returns.... I was wondering if there is an easy way to do this? I've been messing around for a few hours now and I'm able to add a "Test" button; however, it is not in the correct order (I would like it to appear between the Next/Back buttons and it's size is being changed during runtime (I'm assuming this is something to do with the CommandArea object's LayoutManager?)) - see the attached screenshot

I've also wondered if re-purposing (changing the text) of one of the buttons I've hidden may do the trick.... I have a few problems with this:

  • It seems a bit "hackish" 
  • I'm not sure if/how many more buttons we will need to add in the future; however, I do know there's the possibility of running out of buttons to "re-purpose" if we go above three custom buttons

 
Any help / suggestions would be greatly appreciated.

Regards,
Carl

2 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 05 Oct 2011, 12:42 PM
Hello Carl,

Thank you for your question.

You can easily add a custom RadButtonElement (or other TPF element) to WizardCommandArea using code like the following:
RadButtonElement radButtonElement1 = new RadButtonElement();
radButtonElement1.Text = "Button";
radButtonElement1.MinSize = new Size(100, 24);
radButtonElement1.Alignment = ContentAlignment.MiddleRight;
radButtonElement1.Margin = new Padding(4, 0, 4, 0);
 
this.radWizard1.CommandArea.CommandElements.Add(radButtonElement1);

Defining the MinSize of the element helps you identify its size. Using its Alignment property you can position the button left or right in the command area. You can insert the element in a specific position in the CommandElements list to identify its position according to the other command area elements.

You can add different elements to the command area. Following is an example with RadDropDownListElement:
RadDropDownListElement radDropDownListElement = new RadDropDownListElement();
radDropDownListElement.Items.Add("Item1");
radDropDownListElement.Items.Add("Item2");
radDropDownListElement.Items.Add("Item3");
radDropDownListElement.MinSize = new Size(100, 24);
radDropDownListElement.Alignment = ContentAlignment.MiddleRight;
radDropDownListElement.Margin = new Padding(4, 0, 4, 0);
 
this.radWizard1.CommandArea.CommandElements.Add(radDropDownListElement);

I hope it helps.

Best regards,
Alexander
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Holger Boskugel
Top achievements
Rank 2
answered on 03 May 2012, 05:48 PM
Hello,

one comment: If I look in this.radWizard1.CommandArea.CommandElements collection, there are WizardCommandAreaButtonElement placed. So I think should use this.

At the moment I implement such additional button, works fine.

Thanks for this helpfully thread!


Regards from Berlin

Holger Boskugel
Tags
Wizard
Asked by
Carl
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Holger Boskugel
Top achievements
Rank 2
Share this question
or