|
Hi ,
keep it guy...realy one of the best work(as a indivisual) i have ever seen. just amazing effort
Manoj Sahu
|
|
|
|
|
UPDATE: I found the solution and am leaving this here in hopes I save someone else some time. The solution is to create a BindingManagerBase object for EACH step that has bound controls and then increment the .Position property on all of them. This keeps the controls on the different steps in synch. Without this, the controls on Steps 2-x will not update when you change the .Position property.
Dim WizStep1 As WizardBase.WizardStep = Me.wizContract.WizardSteps(0)
Dim WizStep2 As WizardBase.WizardStep = Me.wizContract.WizardSteps(1)
Dim WizStep3 As WizardBase.WizardStep = Me.wizContract.WizardSteps(2)
MyBM1= WizStep1.BindingContext(MyDataTable)
MyBM2= WizStep1.BindingContext(MyDataTable)
MyBM3= WizStep1.BindingContext(MyDataTable)
.
.
.
MyBM1.Positon=MyRecordNumber
MyBM2.Positon=MyRecordNumber
MyBM3.Positon=MyRecordNumber
My Original query follows:
-----------------------------------------------------------------------------
I have a 3 step Wizard, each step has a few standard controls each bound to the same Datasource (ADO.Net Datatable).
All binding is done via code - the datatable populated via a stored procedure. I am not using any of the native data controls.
I create a BindingManager set to the parent object's bindingcontext for the datasource ie:
Private MyBM as BindingManagerBase
.
.
MyBM = Me.BindingContext(MyDataTable)
All of the controls are bound using:
MyControl.DataBindings.Add("PropName", MyDataTable, "ColumnName")
To change the record in the datatable, I set the .Position property of MyBM.
I have used this methodology for years and never had an issue binding controls on Windows forms
With the wizard control however, I have noticed the following.
Setting MyBM to the BindingContext of the parent does not work. It does work when using the .BindingContext of a separately bound control on the same step.
Controls on other steps do NOT get their value set.
I tried putting a bound control on the parent form and bind to that .BindingContext but that does not work either - it only works if it is on the same STEP of the Wizard. (and yes, I also tried the .BindingContext of the Wizard Control)
I'm guessing it has to with the scope of the .BindingContext / controls on the steps, but I would have thought using the parent form/control would have worked as it does with standard forms/user controls.
Has anyone used the wizard with bound objects / have any suggestions?
modified on Friday, February 15, 2008 3:16 PM
|
|
|
|
|
I have found one issue with bound controls that I have yet to resolve -
Binding controls on a 'Finish' Step.
I can successfully, bind a Start or Intermediate step, but using the methods mentioned above, they do not work if the control is on a Finish step.
Anyone else using this wizard with bound controls / have any ideas?
|
|
|
|
|
I successfully added the reference in my project to WizardBase.dll, however, there is no WizardBase group under my toolbox. Did I miss something?
|
|
|
|
|
I had to add the control to the toolbar by myself too. Create a new toolbar and then "Choose Items..." and there select the WizardBase.dll
|
|
|
|
|
If you don't agree to the EULA, shouldn't something different happen compared to when you do agree to it?
|
|
|
|
|
I have been using your initial release (May 2007) and it works very well. While trying to upgrade/replace with your latest release (2/2/08), I am receiving some errors.
When simply replacing the DLL with an existing executable, I receive the following error:
System.MissingMethodException: Method not found: 'WizardBase.WizardStepCollection WizardBase.WizardControl.get_WizardSteps()'.
Within the IDE when the project loads, I receive several errors as well on invalid property names (specifically the step .TitleFont and .SubtitleFont properties).
I attempted to use them separately (renaming the new DLL, placing it in a separate project with same as well as different filename), but apparently they share the same GUID / info, so that isn't possible.
If I REM those property names within the .Designer module, it compiles and works properly. Also, resetting a property, forcing the .Designer module to be recreated also resolves the issue (as those properties are removed). However, ideally - I would prefer not to have to modify/recompile every module that utilizes the DLL. Not a big deal, just thought I would mention it - and perhaps save others using the original code a few minutes when they upgrade.
Otherwise, thank you very much for creating this - it works very well and has saved us a lot of time & effort.
modified on Monday, February 11, 2008 1:31 PM
|
|
|
|
|
Hi ,
The control is not backward compatible.
I will work on this.
Regards,
Manish
|
|
|
|
|
Why always I'm getting this error:
The control System.Windows.Forms.Panel has thrown an unhandled exception in the designer and has benn disbled.
Exception:
Type 'WizardBase.StartStep' in Assembly 'WizardBase', Version 1.0.1.0, Culture=neutrl, PublicKeyToken=null is non marked as serializable.
Stack trace:
at system.Windwos.Forms.Panel.OnResize(EventArgs eventargs)
Help me please.
Thanks.
|
|
|
|
|
HCan you provide me exact repro. That will actuaqlly help me out to figure out the problem.
Regards,
Manish
|
|
|
|
|
This error occurs when i do this:
1) drag the control onto a user control;
2) Set the dock property of the control to Fill;
3) clear the bindingimage an the icon on the firts page;
4) set a new value for the leftpanel apparence the gradiend properties from the smart tag panel;
now select the user control and resize it. Tell me if an error occurs. If no the problem is just fo me and something is wrong on my pc. I'm using VS2008, SCSF, ad Resharp.
Thanks
|
|
|
|
|
Hi, did you try the above steps? Have you got any error?
Thanks.
|
|
|
|
|
Were you able to resolve this?
I too am using this control with SCSF and VS2008. When I dragged the control on to a UserControl (View) and set dock to fill. I get a design-time error from Visual Studio after I change the LeftPair.BackColor property:
Code Generation for property 'LeftPair' failed. Error was: 'Type 'WizardBase.StartStep' in Assembly 'WizardBase, Version 1.0.1.0,Culture=neutral, PublicKeyToken=null' is not marked as serializable'.
Any suggestions?
|
|
|
|
|
I receive the same error. every some time it is popping up :
Code generation for property 'LeftPair' failed. Error was: 'Type 'WizardBase.StartStep' in Assembly 'WizardBase, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.'
I'm using VS 2005
|
|
|
|
|
I am pretty new, but it seems this Wizard Control can save me a lot of time if I can figure out how to use it. Is there any documentation available, or do I need to figure it out on my own? Thanks!
|
|
|
|
|
dysert wrote: documentation available
It would be helpful if you described what you are having trouble understanding. How to use the control seemed pretty simple and straight forward to me from reading the article. The author might update the article with the information you require but he will need to know where you are having trouble understanding.
Just a suggestion.
[Edit] Ah I see where you might have some confusion. The screen shots could probably use some explanation of what the screen shot is in relation to the designer.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Thanks for the prompt reply. Remember I'm just a beginner at this stuff, so the things that may be obvious to the folks here in Codeproject aren't necessarily obvious to a newbie.
For instance, I need to know how to intercept the NextButtonClick event so that I can write some code to do real work when the user clicks the Next button. By looking at the source code for the demo I see what he's done for the Finish button and the Eula button, but when I tried to replicate it in my project I never intercepted the event. Perhaps a code snippet to show how to use a method that will display a MessageBox when the event fires would be good. (Again, I see how it's done in the demo, but despite seeing that I can't get it working in my project.)
For another instance, I don't even know at this point how to add other controls on top of the Wizard control. (I want to display ddlb's, radio buttons, etc., and still have the Back, Next, Cancel buttons available for navigation.) And if I could add another control I wouldn't be sure how to access it, depending where in the navigation stream the user is.
Thanks!
|
|
|
|
|
dysert wrote: I'm just a beginner at this stuff
Yes I understand that. The problem comes from not knowing what you don't know
I do not know the answer to your questions off hand (I haven't actually used the control yet).
But here is what I will do. I am at work now and don't have the time to study this at the moment. What I will do is look this over tonight when I am home and see what I can do to help you out.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Your assistance is greatly appreciated. Thanks!
|
|
|
|
|
Okay I have looked at this for a bit. Maybe I can help you out a bit now. Please don't take any offense to anything that I write.
dysert wrote: intercept the NextButtonClick
dysert wrote: I tried to replicate it in my project
From this and the fact that you are "new" I have come up with a theory. I am going to go with that and leave it up to you to decide if it's right or not. Now, since you could not replicate the event handler, my thought is that you copy/pasted from the demo. Well, there are 2 parts to the event handler. There is the:
private void demoWizard_FinishButtonClick(object sender, EventArgs e)
{
MessageBox.Show("Finishing the wizard.");
Close();
}
If that is all you do, the event won't get fired because it hasn't been added yet. You also need something that looks like:
this.wizardControl1.FinishButtonClick += new System.EventHandler(this.demoWizard_FinishButtonClick);
which "wires" the event to the handler.
The easiest way to add the event handlers for this code seems to be:
Select the control in the designer,
click the Events button (looks like a lightning bolt) in the Properties window
then find the event you want to handle, for you example the event you want to handle is named "NextButtonClick"
Double click in the column next to the event and the event handler will be created for you.
The second part is, you would add the controls the same way you would add any other control. If you look at the first graphic under Step 3, you can see the there is a section named "Step navigation" under the smart tag. Navigate to the step you want to add a control to then drag and drop a control onto the designer for the step. Make sure that the control is above the next-button-control area. The panels of the wizard will contain the control and you can handle the controls directly in your form class. The wizard has a CurrentStepIndex property that will allow you to know which step you are on.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Thank you so much, Wes. Believe me, I would never take offense with anyone kind enough to help me. You're right that I didn't "wire" the event, so that explains that problem. Over the weekend I'm going to work on this, including trying to add other controls. I hope you don't mind if I post additional questions (if I have any -- given your explanations so far I may be able to carry on without any further help).
Thanks again. You've been very kind and helpful.
|
|
|
|
|
Not a problem. Glad to help.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Two more questions (for now :
1. Where do I put the "+=" wire-up code? In the demo it's in a file called Form1.Designer.cs, but I don't have a *Designer file in my project. So where do I do the wiring? (I only have a Form1.cs and a Program.cs)
2. When running the demo, the same EulaButtonClick event fires when I click the Eula button -- no matter what step I'm on. How could I respond to the EulaButtonClick in different ways depending upon which step (Start, Intermediate, Finish) I'm currently on?
Thanks!
|
|
|
|
|
dysert wrote: "+="
The designer puts that code in the Initialize componenet function. Right click on the function call and select "Go to definition" and you will be taken there. Or do a search in all files to find it.
dysert wrote: different ways depending upon which step
you would have to use the current selected index property to find out which page is being displayed to the user.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Thanks, Wes, but despite your help I think I'm in over my head. I did wire the "+=" to fire when the user clicks the Eula button, but the deeper I go the less I understand. I don't expect you to hold my hand, but in case you're curious (or in case someone is going to write up any documentation on this), here are my currently open issues:
1. How are the navigation buttons working? I searched the entire solution for NextButtonClick and found stuff, but I don't understand how it's working. Plus, if knew how to intercept the NetButtonClick event won't my code interfere with the proper operation of the control? I want to do custom stuff and afterward still advance to the next step.
2. I don't know what you're talking about when you mention the "current selected index property". There is a property called CurrentStepIndex, but it remains equal to zero regardless of what step I'm on. Maybe I'm supposed to be changing it? If so, where?
3. I'm not even sure what to do with properties and what with controls. For example, there's something called a WizardControl, which I presume is a control and has properties (like the one I mentioned in #2). There are also things called, e.g., StartStep, which I presume is also a control. I don't know, though, when I'm supposed to be concerned with the WizardControl or the StartStep (or LicenceStep, etc.).
4. I'm not clear on whether I have to add a new WizardControl to a new form for subsequent steps. I assume not -- that if I just add a new Intermediate Step then everything magically links together. But since I don't know the "magic" I don't know how and therefore don't know what I need to do in order to customize what happens when buttons at different Steps are clicked.
Since this topic is on Documentation, may I suggest that someone add a little documentation to include a few code snippets to show how to intercept a button click to do something simple like show a different MessageBox at different Steps. That would go a long way toward helping the newbies (like me) be able to effectively utilize this nice control.
Thank you.
modified on Saturday, February 9, 2008 5:54 PM
|
|
|
|
|