T
terrorix
I have this contruction:
public sealed class CellOptions
{
public int _CellHeight;
public int _CellWidth;
public int CellHeight
{
set { _CellHeight = value; }
get { return _CellHeight; }
}
public int CellWidth
{
set { _CellWidth = value; }
get { return _CellWidth; }
}
}
public class MyCustomControl : System.Web.UI.WebControls.WebControl
{
....
....
....
[Category("CellOptions"), TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public CellOptions CellOptions
{
get { return _CellOptions; }
set { _CellOptions = value; }
}
....
....
....
protected override void Render(HtmlTextWriter output)
{
Table tb = new Table();
tb.Rows.Add( new TableRow() );
TableCell cell = new TableCell();
cell.Width = CellOptions.CellWidth; // <-- here i setup table cell width to CellWidth of CellOptions object
cell.Height = CellOptions.CellHeight; // <-- here i setup table cell height to CellHeight of CellOptions object
tb.Rows[0].Cells.Add( cell );
tb.RenderControl(output);
}
....
....
....
}
I want to have CellOptions property of webcontrol MyCustomControl be expandable like Font class in standard WebControl.
This menas in the properties window in VS.NET will be sign + before CellOptions property, this is done by adding attribe
TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter)) to Celloptions property.
But the problem is that if the user change property CellWidth or CellHeight of CellOptions object I want to
MyCustomControl re-Render the control to respect new values of CellWidth or CellHeight. How do i do that?
thanks a lot...
public sealed class CellOptions
{
public int _CellHeight;
public int _CellWidth;
public int CellHeight
{
set { _CellHeight = value; }
get { return _CellHeight; }
}
public int CellWidth
{
set { _CellWidth = value; }
get { return _CellWidth; }
}
}
public class MyCustomControl : System.Web.UI.WebControls.WebControl
{
....
....
....
[Category("CellOptions"), TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public CellOptions CellOptions
{
get { return _CellOptions; }
set { _CellOptions = value; }
}
....
....
....
protected override void Render(HtmlTextWriter output)
{
Table tb = new Table();
tb.Rows.Add( new TableRow() );
TableCell cell = new TableCell();
cell.Width = CellOptions.CellWidth; // <-- here i setup table cell width to CellWidth of CellOptions object
cell.Height = CellOptions.CellHeight; // <-- here i setup table cell height to CellHeight of CellOptions object
tb.Rows[0].Cells.Add( cell );
tb.RenderControl(output);
}
....
....
....
}
I want to have CellOptions property of webcontrol MyCustomControl be expandable like Font class in standard WebControl.
This menas in the properties window in VS.NET will be sign + before CellOptions property, this is done by adding attribe
TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter)) to Celloptions property.
But the problem is that if the user change property CellWidth or CellHeight of CellOptions object I want to
MyCustomControl re-Render the control to respect new values of CellWidth or CellHeight. How do i do that?
thanks a lot...