Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > form data refresh
 

form data refresh

I have a wizard style form using sql server databinding.  During the wizard steps I collect the users data into a class.  The wizard has multiple user controls (forms) that get loaded into the main form based on a menu.  If the user opens navigates to form1 and edits or enters new values, I pass those values to the class.  When the user navigates back to form1, I load the data from the class back into the form.  The problem is the only way the class data appears is if the user clicks in the control(s) that were edited.  It seems to me I have to validate the controls, and previously I just called this.Validate() and the data was refreshed, but this isn't working with the class data.  Is this because the validate method automatically works with binding sources?  I am thinking I will have to validate each control separately.

Any suggestions?

 

ok.  I think i may have something to do with the user control (form) being loaded into a panel on another form.  I seems like there is a hierarchy with validation and the container controls.  I did try to validate the user control from the main form but that didn't work either.  gonna play around some more.

steveareno  Tuesday, August 29, 2006 4:24 PM
I solved the problem. I changed from

this.Validate();

to

this.ValidateChildren();

and that solved the problem.

steveareno  Tuesday, August 29, 2006 7:11 PM
I solved the problem. I changed from

this.Validate();

to

this.ValidateChildren();

and that solved the problem.

steveareno  Tuesday, August 29, 2006 7:11 PM

You can use google to search for other answers

Custom Search

More Threads

• No Animals teleport to my machine.
• Terrarium 1.2... Are there going to be 'stones' in Terrarium?
• Scheduler
• Another question
• IssueVision How do I add new users to database?
• Failed to load resources from resource file
• Random Tip
• Programmatically reading the thumbprint of digitally signed file.
• Install issue
• Web Based Windows Application