CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 5/20/2004 2:58:51 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 9 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
Imar_Spaanjaars
Asp.Net User
Is there something like a DesignerSurface_OnChange event??5/20/2004 2:58:51 PM

0/0

Hi there,

I have built a custom control with its own designer (ControlA). One of the properties for this control is a text string that can hold the ID of another control that implements specific behavior (ControlB).
I created my own TypeConverter that returns an ArrayList with the specific control IDs of type ControlB in the GetStandardValues method. The IDs are retrieved by looping through the controls on the current page (at design-time).

So, when I drag a new instance of my ControlA on the page, the property grid now shows a drop-down list with the IDs of the controls of type ControlB on the page. So far so good.

However, when I add a new instance of ControlB to the page, the drop-down list for ControlA is not updated to show the new ControlB. This makes sense, as ControlA is not aware of this new instance.

Is there a way to catch an event on the main page whenever it has changed? ControlA could subscribe to that event, and update the drop-down with the new instance of ControlB?

I think the validator controls work like that. Whenever I drag a new text box on the page, the ControlToValidate property is updated. Any ideas how I can simulate this behavior??

Thanks in advance,

Imar

Imar Spaanjaars
http://Imar.Spaanjaars.Com/
===============================================
Everyone is unique, except for me.
AndrewSeven
Asp.Net User
Re: Is there something like a DesignerSurface_OnChange event??5/20/2004 3:11:41 PM

0/0

This could get squirrely... if it is acceptable for you,you might want to use Roeder's Reflector to see how the validators do it.

The first thing I would try is:
TypeDescriptor.Refresh(typeof(ControlA))


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemComponentModelTypeDescriptorClassRefreshTopic4.asp
Imar_Spaanjaars
Asp.Net User
Re: Is there something like a DesignerSurface_OnChange event??5/20/2004 3:49:14 PM

0/0

Hi Andrew,

Thanks for your reply. From what location should I call TypeDescriptor.Refresh?

Another option would be to repopulate the drop-down as soon as an instance of ControlA gets the focus / is selected in the page. However, I couldn't find any OnFocus / OnSelect method for the ControlDesigner.....

Currently I am cheating a bit by building the drop-down from ControlB as well. I'll dig into the Validor controls to see how it's done.


Imar

Imar Spaanjaars
http://Imar.Spaanjaars.Com/
===============================================
Everyone is unique, except for me.
Andy Smith
Asp.Net User
Re: Is there something like a DesignerSurface_OnChange event??5/20/2004 5:49:57 PM

0/0

use this typeconverter code from my blog to make your property a control dropdownlist in the designer
Imar_Spaanjaars
Asp.Net User
Re: Is there something like a DesignerSurface_OnChange event??5/20/2004 6:06:01 PM

0/0

Thanks a lot, Andy. This works great.

The trick that solved the problem was context.Container. In my implementation I couldn't get the container object from within the Converter, so I created the ArrayList with control IDs in the designer rather than in the Converter. That way, I always ended up with an out-dated list of controls.

Your code fixes the issue and resulted in a much cleaner implementation.

Thanks again,


Imar

Imar Spaanjaars
http://Imar.Spaanjaars.Com/
===============================================
Everyone is unique, except for me.
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:





Search This Site:










duplicate tab names

advice to the community : use <br />, not <br>

what are module definitions?

broadcastpollingcachingprovider hardcoded in

adding modules to dnn2

pass parameters to xml/xsl module

dependency 'dotnetnuke.webutility

dnnd4.0 on sql server 2005:throw sql server2005 doesn't allow remote connection~~how to setup it ?

child portals logging out...2.1.2...again....

dnn3.1 on iis5.1 / win xp pro

intrusive registration

how do i specify more than one data providers for the 02.00.00.sqldataprovider file?

problems with a licensed control requiring code inside global.asax and default.aspx - any suggestions?

change the portal email address

new user sign up

a few odd occurances... with 3.1

install problems dotnetnuke 3.1.0-puzzled!

skinning question

can't get dnn 2.0 beta 1 to start!

popup calendar date format

3.0.10 issue: file manager index error

form module

creating a super-simple dotnetnuke module with the executesql dal+ method

santry rdm for dnn 3.x (version 4) ?

can't debug a site created using dotnetnuke 4.0.2 starter kit template

host menu missing

treeview control made with vs.net 2003 for dnn 2.1.2

partnership – ideas – business plan

how to develop a token which integrate to local form ?

some troubles

  Privacy | Contact Us
All Times Are GMT