DataListDesigner クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
DataList Web サーバー コントロールのデザイン時の動作を拡張します。
public ref class DataListDesigner : System::Web::UI::Design::WebControls::BaseDataListDesigner
public class DataListDesigner : System.Web.UI.Design.WebControls.BaseDataListDesigner
[System.Web.UI.Design.SupportsPreviewControl(true)]
public class DataListDesigner : System.Web.UI.Design.WebControls.BaseDataListDesigner
type DataListDesigner = class
inherit BaseDataListDesigner
[<System.Web.UI.Design.SupportsPreviewControl(true)>]
type DataListDesigner = class
inherit BaseDataListDesigner
Public Class DataListDesigner
Inherits BaseDataListDesigner
- 継承
- 属性
例
次のコード例では、 DataListDesigner クラスを拡張する方法を示します。 このコードは、GetDesignTimeHtml コントロールが有効な場合に紫色の 5 点罫線を表示するために、DataList メソッドをオーバーライドします。
using System;
using System.Drawing;
using System.Security.Permissions;
using System.ComponentModel;
using System.Web.UI.WebControls;
using System.Web.UI.Design;
using System.Web.UI.Design.WebControls;
namespace ASPNET.Examples.CS
{
[SecurityPermission(
SecurityAction.Demand,
Flags = SecurityPermissionFlag.UnmanagedCode)]
public class SimpleGridViewDesigner : GridViewDesigner
{
private SimpleGridView simpleGView;
public override string GetDesignTimeHtml()
{
string designTimeHtml = String.Empty;
simpleGView = (SimpleGridView)Component;
// Check the control's BorderStyle property to
// conditionally render design-time HTML.
if (simpleGView.BorderStyle == BorderStyle.NotSet)
{
// Save the current property settings in variables.
int oldCellPadding = simpleGView.CellPadding;
Unit oldBorderWidth = simpleGView.BorderWidth;
Color oldBorderColor = simpleGView.BorderColor;
// Set properties and generate the design-time HTML.
try
{
simpleGView.Caption = "SimpleGridView";
simpleGView.CellPadding = 1;
simpleGView.BorderWidth = Unit.Pixel(3);
simpleGView.BorderColor = Color.Red;
designTimeHtml = base.GetDesignTimeHtml();
}
catch (Exception ex)
{
// Get HTML from the GetErrorDesignTimeHtml
// method if an exception occurs.
designTimeHtml = GetErrorDesignTimeHtml(ex);
// Return the properties to their original values.
}
finally
{
simpleGView.CellPadding = oldCellPadding;
simpleGView.BorderWidth = oldBorderWidth;
simpleGView.BorderColor = oldBorderColor;
}
}
else
{
designTimeHtml = base.GetDesignTimeHtml();
}
return designTimeHtml;
}
protected override string
GetErrorDesignTimeHtml(System.Exception exc)
{
return CreatePlaceHolderDesignTimeHtml(
"ASPNET.Examples: An error occurred while rendering the GridView.");
}
public override void Initialize(IComponent component)
{
simpleGView = (SimpleGridView)component;
base.Initialize(component);
}
}
}
Imports System.Drawing
Imports System.ComponentModel
Imports System.Web.UI.WebControls
Imports System.Security
Imports System.Web.UI.Design
Imports System.Web.UI.Design.WebControls
Namespace ASPNET.Examples
< _
Designer("ASPNET.Examples.Design.SimpleGridViewDesigner", _
"System.Web.UI.Design.GridViewDesigner") _
> _
Public Class SimpleGridView
Inherits GridView
' Code to customize your GridView goes here
End Class
End Namespace
Namespace ASPNET.Examples.Design
<Permissions.SecurityPermission( _
Permissions.SecurityAction.Demand, _
Flags:=Permissions.SecurityPermissionFlag.UnmanagedCode)> _
Public Class SimpleGridViewDesigner
Inherits GridViewDesigner
Private simpleGView As SimpleGridView
Public Overrides Function GetDesignTimeHtml() As String
Dim designTimeHtml As String = String.Empty
simpleGView = CType(Component, SimpleGridView)
' Check the control's BorderStyle property to
' conditionally render design-time HTML.
If (simpleGView.BorderStyle = BorderStyle.NotSet) Then
' Save the current property settings in variables.
Dim oldCellPadding As Integer = simpleGView.CellPadding
Dim oldBorderWidth As Unit = simpleGView.BorderWidth
Dim oldBorderColor As Color = simpleGView.BorderColor
' Set properties and generate the design-time HTML.
Try
simpleGView.Caption = "SimpleGridView"
simpleGView.CellPadding = 1
simpleGView.BorderWidth = Unit.Pixel(3)
simpleGView.BorderColor = Color.Red
designTimeHtml = MyBase.GetDesignTimeHtml()
Catch ex As Exception
' Get HTML from the GetErrorDesignTimeHtml
' method if an exception occurs.
designTimeHtml = GetErrorDesignTimeHtml(ex)
' Return the properties to their original values.
Finally
simpleGView.CellPadding = oldCellPadding
simpleGView.BorderWidth = oldBorderWidth
simpleGView.BorderColor = oldBorderColor
End Try
Else
designTimeHtml = MyBase.GetDesignTimeHtml()
End If
Return designTimeHtml
End Function
Protected Overrides Function _
GetErrorDesignTimeHtml(ByVal exc As Exception) As String
Return CreatePlaceHolderDesignTimeHtml( _
"ASPNET.Examples: An error occurred while rendering the GridView.")
End Function
Public Overrides Sub Initialize(ByVal component As IComponent)
simpleGView = CType(component, SimpleGridView)
MyBase.Initialize(component)
End Sub
End Class
End Namespace
次のコード例は、 DesignerAttribute を使用してデザイナーを DataList コントロールに関連付ける方法を示しています。
[ Designer("ASPNET.Examples.Design.SimpleGridViewDesigner",
"System.Web.UI.Design.GridViewDesigner")]
public class SimpleGridView : GridView
{
// Code to customize your GridView goes here
}
< _
Designer("ASPNET.Examples.Design.SimpleGridViewDesigner", _
"System.Web.UI.Design.GridViewDesigner") _
> _
Public Class SimpleGridView
Inherits GridView
' Code to customize your GridView goes here
End Class
コンストラクター
| 名前 | 説明 |
|---|---|
| DataListDesigner() |
DataListDesigner クラスの新しいインスタンスを初期化します。 |
プロパティ
| 名前 | 説明 |
|---|---|
| ActionLists |
このデザイナーのデザイナー アクション リスト コレクションを取得します。 (継承元 BaseDataListDesigner) |
| ActiveTemplateEditingFrame |
古い.
アクティブなテンプレート編集フレームを取得します。 (継承元 TemplatedControlDesigner) |
| AllowResize |
DataList コントロールのサイズを変更できるかどうかを示す値を取得します。 |
| 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) |
| TemplatesExist |
関連付けられたコントロールに対して定義されたテンプレートがあるかどうかを示す値を取得します。 |
| UsePreviewControl |
コントロール デザイナーが一時的なプレビュー コントロールを使用してデザイン時 HTML マークアップを生成するかどうかを示す値を取得します。 (継承元 ControlDesigner) |
| Verbs |
このデザイナーで使用できる動詞のコレクションを取得します。 (継承元 BaseDataListDesigner) |
| ViewControl |
デザイン時の HTML マークアップのプレビューに使用できる Web サーバー コントロールを取得または設定します。 (継承元 ControlDesigner) |
| ViewControlCreated |
デザイン サーフェイスに表示する |
| Visible |
コントロールがデザイン時に表示されるかどうかを示す値を取得します。 (継承元 ControlDesigner) |