DataGridDesigner クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
DataGrid Web サーバー コントロールのデザイン時の動作を拡張します。
public ref class DataGridDesigner : System::Web::UI::Design::WebControls::BaseDataListDesigner
public class DataGridDesigner : System.Web.UI.Design.WebControls.BaseDataListDesigner
[System.Web.UI.Design.SupportsPreviewControl(true)]
public class DataGridDesigner : System.Web.UI.Design.WebControls.BaseDataListDesigner
type DataGridDesigner = class
inherit BaseDataListDesigner
[<System.Web.UI.Design.SupportsPreviewControl(true)>]
type DataGridDesigner = class
inherit BaseDataListDesigner
Public Class DataGridDesigner
Inherits BaseDataListDesigner
- 継承
- 属性
例
次のコード例では、 DataGridDesigner クラスを拡張する方法を示します。 このコードは、DataGrid コントロールがデザイン サーフェイスにレンダリングされるときに、CellPadding、BorderWidth、およびBorderColorプロパティをカスタマイズするために、GetDesignTimeHtml メソッドをオーバーライドします。
Imports System.Diagnostics
Imports System.ComponentModel
Imports System.Drawing
Imports System.Web.UI.Design.WebControls
Imports System.Web.UI.WebControls
Namespace Examples.AspNet
' Create a designer class for the SimpleDataList class.
<System.Security.Permissions.SecurityPermission( _
System.Security.Permissions.SecurityAction.Demand, _
Flags:=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)> _
Public Class SimpleDataListDesigner
Inherits DataListDesigner
Private simpleList As SimpleDataList
' Override the GetDesignTimeHtml method to add style to the control
' on the design surface.
Public Overrides Function GetDesignTimeHtml() As String
' Cast the control to the Component property of the designer.
simpleList = CType(Component, SimpleDataList)
Dim designTimeHtml As String = Nothing
' Create variables to hold current property values.
Dim oldBorderWidth As Unit = simpleList.BorderWidth
Dim oldBorderColor As Color = simpleList.BorderColor
' Set the properties and generate the design-time HTML.
If (simpleList.Enabled) Then
Try
simpleList.BorderWidth = Unit.Point(5)
simpleList.BorderColor = Color.Purple
designTimeHtml = MyBase.GetDesignTimeHtml()
' Call the GetErrorDesignTimeHtml method if an
' exception occurs.
Catch ex As Exception
designTimeHtml = GetErrorDesignTimeHtml(ex)
' Return the properties to their original settings.
Finally
simpleList.BorderWidth = oldBorderWidth
simpleList.BorderColor = oldBorderColor
End Try
' If the list is not enabled, call the GetEmptyDesignTimeHtml
' method.
Else
designTimeHtml = GetEmptyDesignTimeHtml()
End If
Return designTimeHtml
End Function
Protected Overrides Function GetEmptyDesignTimeHtml() As String
Dim emptyText As String
' Check the CanEnterTemplateMode property to
' specify which text to display if ItemTemplate
' does not contain a value.
If CanEnterTemplateMode Then
emptyText = _
"<b>Either the Enabled property value is false " + _
"or you need to set the ItemTemplate for this " + _
"control.<br>Right-click to edit templates.</b>"
Else
emptyText = _
"<b>You cannot edit templates in this view.<br>" + _
"Switch to HTML view to define the ItemTemplate.</b>"
End If
Return CreatePlaceHolderDesignTimeHtml(emptyText)
End Function
' Generate HTML to indicate that an error has occurred.
Protected Overrides Function GetErrorDesignTimeHtml(ByVal exc As _
Exception) As String
Return CreatePlaceHolderDesignTimeHtml( _
"<b>An error occurred</b>.<br>Check to ensure that all " + _
"properties are valid.")
End Function
' Override the Initialize method to ensure that
' only an instance of the SimpleDataList class is
' used by this designer class.
Public Overrides Sub Initialize(ByVal component As IComponent)
simpleList = CType(component, SimpleDataList)
If IsNothing(simpleList) Then
Throw New ArgumentException("Must be a SimpleDataList.", "component")
End If
MyBase.Initialize(component)
End Sub
End Class
End Namespace
次の例では、 DesignerAttribute 属性を使用してデザイナーを DataGrid コントロールに関連付ける方法を示します。
' Override the Initialize method to ensure that
' only an instance of the SimpleDataList class is
' used by this designer class.
Public Overrides Sub Initialize(ByVal component As IComponent)
simpleList = CType(component, SimpleDataList)
If IsNothing(simpleList) Then
Throw New ArgumentException("Must be a SimpleDataList.", "component")
End If
MyBase.Initialize(component)
End Sub
コンストラクター
| 名前 | 説明 |
|---|---|
| DataGridDesigner() |
DataGridDesigner クラスの新しいインスタンスを初期化します。 |
プロパティ
| 名前 | 説明 |
|---|---|
| ActionLists |
このデザイナーのデザイナー アクション リスト コレクションを取得します。 (継承元 BaseDataListDesigner) |
| ActiveTemplateEditingFrame |
古い.
アクティブなテンプレート編集フレームを取得します。 (継承元 TemplatedControlDesigner) |
| AllowResize |
デザイン時環境でコントロールのサイズを変更できるかどうかを示す値を取得します。 (継承元 ControlDesigner) |
| AssociatedComponents |
デザイナーによって管理されるコンポーネントに関連付けられているコンポーネントのコレクションを取得します。 (継承元 ComponentDesigner) |
| AutoFormats |
このデザイナーに関連付けられている DesignerAutoFormatCollection オブジェクトを取得します。 |
| Behavior |
古い.
デザイナーに関連付けられている DHTML 動作を取得または設定します。 (継承元 HtmlControlDesigner) |
| CanEnterTemplateMode |
このデザイナーがテンプレートの表示または編集を許可するかどうかを示す値を取得します。 (継承元 TemplatedControlDesigner) |
| Component |
デザイナーが設計しているコンポーネントを取得します。 (継承元 ComponentDesigner) |
| DataBindings |
現在のコントロールのデータ バインディング コレクションを取得します。 (継承元 HtmlControlDesigner) |
| DataBindingsEnabled |
デザイナーがデータ バインディングを許可するかどうかを示す値を取得します。 (継承元 TemplatedControlDesigner) |
| DataKeyField |
関連付けられているコントロールのデータ キー フィールドの値を取得または設定します。 (継承元 BaseDataListDesigner) |
| DataMember |
関連付けられたコントロールのデータ メンバー フィールドの値を取得または設定します。 (継承元 BaseDataListDesigner) |
| DataSource |
関連付けられたコントロールのデータ ソース プロパティの値を取得または設定します。 (継承元 BaseDataListDesigner) |
| DataSourceDesigner |
データ バインディング用にデータ ソースが選択されている場合に、データ ソースのデザイナーを取得します。 (継承元 BaseDataListDesigner) |
| DataSourceID |
デザイナーのバージョンのデータ ソース ID プロパティを取得または設定し、関連付けられているコントロールの対応するプロパティをシャドウするために使用します。 (継承元 BaseDataListDesigner) |
| DesignerState |
デザイン時に関連付けられたコントロールのデータを保持するために使用されるオブジェクトを取得します。 (継承元 ControlDesigner) |
| DesignerView |
関連付けられたコントロールにバインドされているデータ ソースの既定のビューを取得します。 (継承元 BaseDataListDesigner) |
| DesignTimeElement |
古い.
デザイン サーフェイス上の HtmlControlDesigner オブジェクトに関連付けられているコントロールを表すデザイン時オブジェクトを取得します。 (継承元 HtmlControlDesigner) |
| DesignTimeElementView |
古い.
コントロール デザイナーのビュー コントロール オブジェクトを取得します。 (継承元 ControlDesigner) |
| DesignTimeHtmlRequiresLoadComplete |
デザイン時マークアップを表示するために読み込みが完了する必要があるかどうかを示す値を取得します。 (継承元 BaseDataListDesigner) |
| Expressions |
デザイン時の現在のコントロールの式バインドを取得します。 (継承元 HtmlControlDesigner) |
| HidePropertiesInTemplateMode |
コントロールがテンプレート編集モードになったときにコントロールのプロパティを非表示にするかどうかを示す値を取得します。 (継承元 TemplatedControlDesigner) |
| ID |
コントロールの ID 文字列を取得または設定します。 (継承元 ControlDesigner) |
| InheritanceAttribute |
関連付けられているコンポーネントの継承の種類を示す属性を取得します。 (継承元 ComponentDesigner) |
| Inherited |
このコンポーネントが継承されるかどうかを示す値を取得します。 (継承元 ComponentDesigner) |
| InTemplateMode |
古い.
デザイナー ドキュメントがテンプレート モードかどうかを示す値を取得します。 (継承元 TemplatedControlDesigner) |
| IsDirty |
古い.
Web サーバー コントロールが変更済みとしてマークされているかどうかを示す値を取得または設定します。 (継承元 ControlDesigner) |
| ParentComponent |
このデザイナーの親コンポーネントを取得します。 (継承元 ComponentDesigner) |
| ReadOnly |
古い.
コントロールのプロパティがデザイン時に読み取り専用かどうかを示す値を取得または設定します。 (継承元 ControlDesigner) |
| RootDesigner |
関連付けられたコントロールを含む Web フォーム ページのコントロール デザイナーを取得します。 (継承元 ControlDesigner) |
| ShadowProperties |
ユーザー設定をオーバーライドするプロパティ値のコレクションを取得します。 (継承元 ComponentDesigner) |
| ShouldCodeSerialize |
古い.
シリアル化中に、現在のデザイン ドキュメントの分離コード ファイルでコントロールのフィールド宣言を作成するかどうかを示す値を取得または設定します。 (継承元 HtmlControlDesigner) |
| Tag |
関連付けられたコントロールの HTML マークアップ要素を表すオブジェクトを取得します。 (継承元 ControlDesigner) |
| TemplateGroups |
テンプレート定義を含むテンプレート グループのコレクションを取得します。 (継承元 TemplatedControlDesigner) |
| UsePreviewControl |
コントロール デザイナーが一時的なプレビュー コントロールを使用してデザイン時 HTML マークアップを生成するかどうかを示す値を取得します。 (継承元 ControlDesigner) |
| Verbs |
このデザイナーで使用できる動詞のコレクションを取得します。 (継承元 BaseDataListDesigner) |
| ViewControl |
デザイン時の HTML マークアップのプレビューに使用できる Web サーバー コントロールを取得または設定します。 (継承元 ControlDesigner) |
| ViewControlCreated |
デザイン サーフェイスに表示する |
| Visible |
コントロールがデザイン時に表示されるかどうかを示す値を取得します。 (継承元 ControlDesigner) |