Undeleting a Control


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
I did the unthinkable.  I deleted a grid from a form.  Crazy  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

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Is there a "trick" to getting an undeleted control working again?

Yup...source control! Crazy

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 Pinch  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.

Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Pinch 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!

Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
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.

Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
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

Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
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.

Keith Chisarik

Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
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 BigGrin 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.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search