Home     About PeterBlum.com     Policies     Download a Licensed Product     Newsletter
PropertiesEditor  
Current Release: 1.0.2  Release History
Jump to: Demos | Syntax Example | Download

The PropertiesEditor class is an ASP.NET implementation of the Property window found in Visual Studio.NET.
ASP.NET Control developers can use it to show off the properties of their products on their web pages. The users can even use the PropertiesEditor to change properties of the control. This becomes an invaluable selling and communication tool for control developers. Best of all, its free!

Features

  • It permits editing. However, you can turn this off to simply let users review the properties.
  • Automatically shows the DescriptionAttribute found on each property both as a tooltip and in the browser's status bar.
  • Optionally shows Read Only properties (those with a GET but no SET identifier).
  • Optionally shows properties of ancestor classes to help you focus the users on your properties.
  • Optionally shows a the datatype or class of each property.
  • Filters can remove properties by name or class/datatype.
  • Optionally shows protected and private properties.
  • Optionally shows properties whose BrowsableAttribute is false (which would hide it in VS.NET's Property window.)
  • Shows ITemplates and permits entry of straight HTML into them.
  • Source code in C# is included. The implementation uses the .NET Reflection system for Properties and Enums extensively. It should be a useful learning tool in these areas.
  • Supports most types of properties and includes specialized editors based on the types:
    • All primative types - Integers, reals, bools, strings
    • Enumerated types - drop list shows all enumerated values
    • Templates - you can enter text which will be assigned to a LiteralControl
    • Colors - drop list with all named colors
    • FontUnit, Unit, DateTime classes
    • All objects - child objects are hidden. Click a button to reveal their properties.
    • Indexers - includes the Items property of all IList classes supplied in the framework.
      Click a button to reveal the individual items. Click a button the item to reveal their properties. NOTE: you cannot add or delete from the Indexers list.

Demos

Here are two controls. The first is a typical DropDownList, using the ASP.NET DropDownList class. The Properties Editor is below it.

Use the PropertiesEditor to reveal and edit properties of the DropDownList. You will not be able to add or delete items from the list, but you can edit them.
Click Submit to update the DropDownList.
There is second PropertiesEditor control attached to the first. It reveals the properties of the PropertiesEditor control and provides a control panel to customize the Properties Editor itself!



AccessKeyString
AppendDataBoundItemsBoolean
AutoPostBackBoolean
BackColorColor
CausesValidationBoolean
ClientIDModeClientIDMode
CssClassString
DataMemberString
DataSourceIDString
DataTextFieldString
DataTextFormatStringString
DataValueFieldString
EnabledBoolean
EnableThemingBoolean
EnableViewStateBoolean
FontFontInfo
ForeColorColor
HeightUnit
IDString
ItemsListItemCollection
ItemTypeString
SelectedIndexInt32
SelectMethodString
SkinIDString
TabIndexInt16
ToolTipString
ValidateRequestModeValidateRequestMode
ValidationGroupString
ViewStateModeViewStateMode
VisibleBoolean
WidthUnit


Control panel for Properties Editor:
xBrowsableAttributeMode
xCacheMinutes
xControlToView
xHideAncestorPropsB
xNameFilter
xShowNonPublicB
xShowReadOnlyB
xShowTypeColumnB
xTypeFilter
xViewOnlyB



ASP.NET Syntax Example

Here is the ASP.Net Syntax for the two PropertiesEditors shown above. The DropDownList of this example has the Control ID of DropDownList1.
<Prop:PropertiesEditor id="PropertiesEditor1" runat="server" 
      CssClass="PropertiesEditor" xControlToView=DropDownList1 />
<br>
<asp:button id="Button1" runat="server" CausesValidation="False" Text="Submit" />
<br>
Control panel for Properties Editor:
<br>
<Prop:PropertiesEditor id="PropertiesEditor2" runat="server" 
      CssClass="PropertiesEditor" xControlToView=PropertiesEditor1 
      xShowTypeColumnB="False" xHideAncestorPropsB="True" />
<br>
<asp:button id="Button2" runat="server" CausesValidation="False" Text="Submit" />
Here is the CodeBehind for this example, using C#.
private void Page_Load(object sender, System.EventArgs e)
{
   Button1.Click += new System.EventHandler(Submit_Click);
   Button2.Click += new System.EventHandler(SubmitCustomize_Click);
   PropertiesEditor2.xLevelColors[0] = Color.AntiqueWhite;
   if (!this.IsPostBack)
   {
      PropertiesEditor2.DataBind();
      PropertiesEditor1.DataBind();
   }
}  // Page_Load
protected void Submit_Click(object sender, System.EventArgs e)
{
   PropertiesEditor1.UpdateInstance();
}  // Submit_Click

protected void SubmitCustomize_Click(object sender, System.EventArgs e)
{
   PropertiesEditor2.UpdateInstance();
   PropertiesEditor1.DataBind();
}  // Submit_Click

Download

Product PropertiesEditor
Version 1.0 (Current release: 1.0.2)
Price Free
Restricted Usage Unrestricted. A donation to the .Net development community. However, it is distributed "AS IS".
Source Code Included
Language C#
Compatibility Microsoft .Net 1.0 and 1.1
Installation You will download a Zip file named PropertiesEditor.zip. Extract its contents. It will place all files into a folder named PropertiesEditor.
Documentation Once installed, read the file Documentation.rtf in WordPad or a word processor for instructions on how to compile the control and connect it to your ASP.NET web application.
The source code is also documented.

Download this file