Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > ExpandableObjectConverter (Almost Working)

Reply
Thread Tools

ExpandableObjectConverter (Almost Working)

 
 
Ron Vecchi
Guest
Posts: n/a
 
      11-23-2003
I have a custom control inheriting from System.Web.UI.Control. I
implemented the ExpandableObjectConverter and everything is working fine in
the designer. The proerty is expanded and I can select the child properties
and the change is displayed to the parent.

When my custom control renders, an html atribute is created from the values
of both child properties of the parent property. ex (salign="LB").
How can I get this to show up in my Html View when I set the child
properties in design view? Right now nothing is displayed in the controls
html view when I change the properties in design. Also when I build my
project my newly set child properties are rcleared from the poperties
window.


////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////
//////////////////// Custom control property
///////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////
[Browsable(true),
Description("Gets or Sets the Flash Horizontal and Vertical Alignment
Parameters."),
Category("Alignment"),
PersistenceMode(PersistenceMode.InnerProperty),
DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]
public FlashMovieAlignment FlashAlignment {
get {return this._mflashalign;}
set {this._mflashalign = value;}
}

////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////
//////////////////// Class that is Expandable in design view of custom
control ////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////
[TypeConverter(typeof(ExpandableObjectConverter))]
public class FlashMovieAlignment {

private FlashHorizontalAlignment _halign;
private FlashVerticalAlignment _valign;



[DefaultValue(typeof(DHelixWebControls.UI.FlashHori zontalAlignment),"Center"
),
NotifyParentProperty(true),
RefreshProperties(RefreshProperties.Repaint)]
public FlashHorizontalAlignment HorizontalAlign {
get {return this._halign;}
set {this._halign = value;}
}


[DefaultValue(typeof(DHelixWebControls.UI.FlashVert icalAlignment),"Center"),
NotifyParentProperty(true),
RefreshProperties(RefreshProperties.Repaint)]
public FlashVerticalAlignment VerticalAlign {
get {return this._valign;}
set {this._valign = value;}
}


public FlashMovieAlignment() {

this.Initialize(FlashHorizontalAlignment.Center,Fl ashVerticalAlignment.Cente
r);
}
}


Thanks
--
Ron Vecchi


 
Reply With Quote
 
 
 
 
MSFT
Guest
Posts: n/a
 
      11-24-2003
Hi Ron,

You may take a look at following article to see if it will help:

http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconcontrolparsingcustomattributescontrolbuilders .asp

Especailly, you may try to create a custom ControlBuilder class to see if
it will help. For more information on web controls design time support, you
may refer to:

http://longhorn.msdn.microsoft.com/l...ign-timesuppor
t.aspx

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help on ExpandableObjectConverter layos ASP .Net Web Controls 1 01-23-2008 12:10 PM
MyCustomControl, ExpandableObjectConverter, OnValueChanged terrorix ASP .Net Building Controls 0 05-14-2004 07:54 AM
ExpandableObjectConverter stefano mostarda ASP .Net Building Controls 2 11-02-2003 10:01 AM



Advertisments