Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / April 2007

Tip: Looking for answers? Try searching our database.

Custom control loading order

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
devtotal@com.com - 27 Apr 2007 09:29 GMT
Hi, I have a custom control which loads data, with some critera from a
property of the hosting UserControl.

I try to get the property value on BindingChanged in my custom control,
but, at that time, host UserControl is not completly loaded, so my
property is NULL.

I can't call a custom control's method from host UserControl. It would
'destroy' the automatic behaviour...

How can I know in my custome control that the host UserControl has
finished to load ?

TIA
John Saunders [MVP] - 27 Apr 2007 09:36 GMT
> Hi, I have a custom control which loads data, with some critera from a
> property of the hosting UserControl.
[quoted text clipped - 8 lines]
> How can I know in my custome control that the host UserControl has
> finished to load ?

Instead of having the custom control grab a property of the hosting control,
why not have the hosting control set a property of the custom control?
Signature


John Saunders [MVP]

devtotal@com.com - 27 Apr 2007 09:55 GMT
Because, I can have up to 15 custom controls of diferent types using the
 UserControl's value in 40 UserControls...

I could loop for my custom control type, and set the value in each ot
the UserControls , but it's a lot more code, and i want it to be as
readible as possible...

So, I only wonder if the custom control has a 'Framework' way to know
that the host UserControl is loaded...

John Saunders [MVP] a écrit :
>> Hi, I have a custom control which loads data, with some critera from a
>> property of the hosting UserControl.
[quoted text clipped - 11 lines]
> Instead of having the custom control grab a property of the hosting control,
> why not have the hosting control set a property of the custom control?
John Saunders [MVP] - 27 Apr 2007 18:02 GMT
> Because, I can have up to 15 custom controls of diferent types using the
> UserControl's value in 40 UserControls...

Well, I don't have much more to offer, other than the observation that your
design seems to be too tightly-coupled.

Perhaps your custom controls could implement some particular interface. Your
user controls could then recursively search their Controls collection for
controls which implement this interface. You could even move this code into
a common base class for the user controls.
Signature

John Saunders [MVP]


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.