?
Solved

hide wizard control buttons C#

Posted on 2006-11-09
7
Medium Priority
?
833 Views
Last Modified: 2012-08-13
I have a wizard control and I need to hide and show the buttons at certain points. Here is what I have tried, but it doesn't work:

private void ShowHideWizardButtons(bool ShowBack, bool ShowNext, bool ShowSaveAndExit)
    {
        ((Button)ProjectWizard.FindControl("StepNavigationTemplateContainerID$StepPreviousButton")).Visible = ShowBack;
        ((Button)ProjectWizard.FindControl("StepNavigationTemplateContainerID$StepNextButton")).Visible = ShowNext;
        ProjectWizard.DisplayCancelButton = ShowSaveAndExit;
    }


private void ShowHideWizardButtons(bool ShowBack, bool ShowNext, bool ShowSaveAndExit)
    {
        ((Button)ProjectWizard.FindControl("StepPreviousButton")).Visible = ShowBack;
        ((Button)ProjectWizard.FindControl("StepNextButton")).Visible = ShowNext;
        ProjectWizard.DisplayCancelButton = ShowSaveAndExit;
    }


Any ideas?
0
Comment
Question by:strickdd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17906334
What is not working?  FindControl?

Bob
0
 
LVL 28

Author Comment

by:strickdd
ID: 17906365
It is not hiding the buttons. The second one says the control doesn't exist.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17906408
The wizard control does a lot of stuff in the background that is not always readily available to override.  Maybe the fact that this doesn't work is because there is code that re shows the button at the wrong time.  A lot of times this is a timing issue, and not always easy to find a solution.

Bob

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:rawlinpa
ID: 17907726
Manually loop through the controls on the page searching for one with ID of the wizard control button and set that to be visible or not
0
 
LVL 28

Author Comment

by:strickdd
ID: 17907732
rawlinpa,
   Do you have any Utilities to do this "FindControl" strategy?
0
 
LVL 1

Accepted Solution

by:
rawlinpa earned 2000 total points
ID: 17907764
public static System.Web.UI.Control FindControl(Type ControlType, System.Web.UI.ControlCollection Controls)
{
      for (int counter = 0; counter < Controls.Count; ++counter) // loop through each control in the control collection
      {
            if (Controls[counter].GetType() == ControlType) //see if the current control is a match
            {
                  return Controls[counter];
            }
            else if (Controls[counter].Controls.Count > 0) // check the child controls
            {
                  System.Web.UI.Control FoundControl = FindControl(ControlType, Controls[counter].Controls); // recursive call to check child controls

                  if (FoundControl != null) // control found in child's controls
                  {
                        return FoundControl;
                  }
            }
      }

      return null;
}
0
 
LVL 28

Author Comment

by:strickdd
ID: 17907774
Perfect, I didn't even think of that!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question