Prev | Current Page 711 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"

Probably the most familiar component editor in ASP.NET is the DataGrid??™s
component editor. It provides a convenient interface to quickly configure a DataGrid??™s numerous
properties. You may have noticed this attribute on the previous TitledThumbnail server control:
EditorAttribute(typeof(TitledThumbnailComponentEditor),typeof(ComponentEditor))
This attribute is what associates the ComponentEditor with a server control. Building a
component editor is different from what we have done so far, because component editors are
considered part of .NET Windows Forms based on its namespace. The namespace for the base
class ComponentEditor is System.Windows.Forms.Design.
Component editors consist of a ComponentEditor-based class and a ComponentEditorDlg
Windows Form. The custom ComponentEditor class instantiates the component editor dialog
box, initiates a DesignerTransaction, and either commits or rolls back any changes depending
on whether the user clicks OK or Cancel on the component editor dialog box.
The Component Editor Dialog Box
Building the component editor dialog box is a matter of deciding what server control functionality
to expose for configuration and laying out Windows Forms controls on the Windows Form
that represents the editing dialog box on the Component Designer surface.


Pages:
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723