I am trying to programatically disable my custom wizard page's Next button using the EnableStep method of the wizard class.
this.EnableStep(false);
But this isn't working. Is there any other way to control the enable property of the different wizard buttons ? |
| Sonnet Thursday, May 25, 2006 3:00 PM |
Try using the IsValid property of your custompage. It should return true if all values are correct, then enable or disable the next button according that.
|
| Jose Escrich Friday, May 26, 2006 2:07 PM |
Try this:
bool enable = /* however you want to set it */ false;
Wizard.EnableButton(Microsoft.WizardFramework.ButtonType.Next, enable);
|
| farproc2000 Thursday, May 25, 2006 9:22 PM |
Using : Wizard.EnabledButton(Microsoft.WizardFramework.ButtonType.Finish, false); ...doesn't work to disable "step skipping", I tried it in the Load event and the constructor of my CustomWizardPage. Is there any way to force the user to pass through every step before hitting the Finish button?
|
| Renaud Bédard Friday, May 26, 2006 1:31 PM |
Try using the IsValid property of your custompage. It should return true if all values are correct, then enable or disable the next button according that.
|
| Jose Escrich Friday, May 26, 2006 2:07 PM |
If that reply was meant for me, that's not what I meant. I want to force the user to go through all wizard pages, not all the elements of a single page. This is done automatically if you don't overload IsValid.
|
| Renaud Bédard Friday, May 26, 2006 5:23 PM |
Thank you for that tip. I am now able to force the user to enter the right data on every page before I let him navigate to the next page. |
| Sonnet Monday, May 29, 2006 2:22 AM |
try this...
private void Button4_Click(object sender, System.EventArgs e)
{
this.Button4.Enabled=false;
} |
| iMo Friday, June 02, 2006 2:31 AM |
I had the same problem and because I came to a solution, I thought to share it whith others. The code bellow has been put inside the page where wizard control sits.It will disable allsubmit buttonsfrom the page until the page is again fully loaded.
< script type="text/javascript">
if (typeof(__doPostBack) == "function")
{
var Original__doPostBack = __doPostBack;
__doPostBack = function(eventTarget, eventArgument)
{
DisableWizardButtons();
Original__doPostBack(eventTarget, eventArgument);
}
}
function DisableWizardButtons()
{
var els = document.getElementsByTagName('input');
for (i=0;i<els.length;i++)
{
if (els .type == 'submit')
{
els .disabled = true;
}
}
}
</ script> |
| eduard.gruber Thursday, May 03, 2007 4:16 AM |