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 / Windows Forms / Design Time / May 2004

Tip: Looking for answers? Try searching our database.

How to make sure your component's initialization order

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tester - 18 May 2004 12:41 GMT
Hi,

How does one handle component's initialization when order is important.

Here is an example, my component can be used for databinding by others.
It is possible that DataGrid.DataSource=myComponent; is placed before my
component's
initialization by designer. I found that it just depends on which component
was placed first
on designer surface.

How does one handle this situation?

Thank you
"Jeffrey Tan[MSFT]" - 19 May 2004 03:51 GMT
Hi Tester,

Based on my understanding, you want to give certain initialize order rule
for your component.

Actually, it is not recommanded for you to develop a custom control has the
strong dependency on another control. Your logic may have this dependency,
but you should not apply this dependency at design-time. For example, if
DataGrid does not bind to a dataset, it can not do anything(We first does
not talk about other datasource). But if we drag a datagrid on to the
designer, we still allow it to be created.

Usually, I think ISupportInitialize interface may meet your need, use it,
you can determine if certain property of this component is set, then you
can signal the initialize complete in ISupportInitialize.EndInit(), for
more information, please refer to:
http://www.howtodothings.com/showarticle.asp?article=581

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

"Jeffrey Tan[MSFT]" - 26 May 2004 03:58 GMT
Hi Tester,

Does my reply make sense to you? Do you still have concern on this issue?

Please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Tester - 28 May 2004 03:46 GMT
Hi Jeffrey,

Thank you for posting a reply.

For some reason I thought databinding took place when .DataSource was
assigned. For example,
dataGrid1.DataSource = someData;

But it's not. Data binding happens after InitializeComponent completes. It
seems to work fine now. If i hit the non working case, I'll post again.

Thank you

> Hi Tester,
>
[quoted text clipped - 7 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.

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.