Undeleting a Control


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K 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

Replies
Paul Chase
Paul Chase
Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 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.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K 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

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