StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Undeleting a ControlExpand / Collapse
Author
Message
Posted 07/11/2008 11:07:48 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/25/2008 7:55:39 AM
Posts: 473, Visits: 1,955
I did the unthinkable.  I deleted a grid from a form.    The grid has been in use for quite a while and has had many changes over the last several months.  My last commitment to source control was several days ago.  Since I did not want to lose all of the work since then, and I had caught myself right away, I did the next best thing...CTRL-Z.  The grid came back.  I wiped the sweat from my brow and breathed a heavy sigh of relief.

Alas!  When I run the app (debug mode), the grid comes up "empty".  It shows that there are 31 records (count in column 1), but there is no data showing up.  I have built, rebuilt, changed the grid, built, rebuilt again.  I reset the datasource (removed the BBS, save, reset the BBS, saved again).  I am running out of ideas about why this may be happening. 

Is there a "trick" to getting an undeleted control working again?

Thanks,
Bill

Post #17800
Posted 07/11/2008 11:21:00 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 7:08:30 PM
Posts: 4,811, Visits: 4,781
Is there a "trick" to getting an undeleted control working again?

Yup...source control!

It is really difficult to supply an answer without actually having the designer file and source code in hand...and even then, no guarantees!

I know that you don't need or want to hear this, but you should really be checking in your work a lot more often...for this very reason   I am a check-in junkie and check-in when I am finished with a particular segment of code.  But regardless, we always check-in everything before we shut down for the day.

Post #17801
Posted 07/11/2008 12:33:17 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/25/2008 7:55:39 AM
Posts: 473, Visits: 1,955
Painful.

I reverted.  I printed everything I could, including screen shots.  I will work on getting the last three or so days updated on that one form. 

Lesson learned:  Become a source control addict.

Thanks!

Post #17802
Posted 07/11/2008 1:45:59 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 4:29:41 PM
Posts: 367, Visits: 2,446
Bill,

One problem you might have is that once the object gets deleted visual studio removes the handles statement and if you Ctrl Z it it does not re-apply the event handlers,

ie private sub  somethingclicked(sender as object, e as event arg) handles something.clicked

after deleted becomes somethingclicked(sender as object, e as event arg)

after Ctrl Z the handler is still misssing so your code never executes, same thing if you cut and paste an object.

Post #17806
Posted 07/11/2008 2:23:50 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/25/2008 7:55:39 AM
Posts: 473, Visits: 1,955
Next time (hopefully, there will not be a next time) I will see how C# handles these handlers.  Apparently, the designer drops the definitions, then, like this one:

this.Load += new System.EventHandler(this.ProductionRequirements_Load);

Thanks,
Bill

Post #17807
Posted 07/11/2008 6:03:43 PM


Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 9:57:58 PM
Posts: 658, Visits: 27,148
I was bitten bad enough once that I have a small banner over my door that I run into every day before I leave my office, "DID YOU COMMIT TO SOURCESAFE?"

Sad , but true.

Post #17808
Posted 07/11/2008 6:48:28 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 4:29:41 PM
Posts: 367, Visits: 2,446
Keith Chisarik (07/11/2008)
I was bitten bad enough once that I have a small banner over my door that I run into every day before I leave my office, "DID YOU COMMIT TO SOURCESAFE?"

Sad , but true.

That's 2 funny I have a daily reminder in outlook set to go off at 12 noon and 5 :30 The lunch time one has saved me alot of pain, sometimes I go next door to the strip club for lunch (they have a really great buffet) . And for some unknown reason I sometimes make mistakes later that afternoon and it is really nice to have my morning's work safe and secure.

Post #17809
Posted 07/12/2008 9:36:31 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 7:08:30 PM
Posts: 4,811, Visits: 4,781
LOL...we all have our methods!  I have Visual Studio setup to remind me when I exit VS...you can setup an Option within Visual Studio to check things in when closing a Solution or project.  You can elect not when when it pops up, but at least it does in fact pop up as a reminder:

But Paul is also right in that the event handlers do get "smoked."  That is probably what was part of your problem...but the problem there too can be getting Humpty Dumpty back together again correctly depending on how large the program is and how many events, etc. were removed.

Post #17812
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 2:15am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.125. 11 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.