AutoGeneratedFieldProperties クラスとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > AutoGeneratedFieldProperties クラスの意味・解説 

AutoGeneratedFieldProperties クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

AutoGeneratedField オブジェクトプロパティ表します。このクラス継承できません。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 AutoGeneratedFieldProperties
    Implements IStateManager
Dim instance As AutoGeneratedFieldProperties
public sealed class AutoGeneratedFieldProperties
 : IStateManager
public ref class AutoGeneratedFieldProperties
 sealed : IStateManager
public final class AutoGeneratedFieldProperties
 implements IStateManager
public final class AutoGeneratedFieldProperties
 implements IStateManager
解説解説

AutoGeneratedFieldProperties クラスは、データ バインド コントロールによって使用され自動生成フィールド作成時に AutoGeneratedField オブジェクトプロパティ指定します。たとえば、DetailsView コントロール自動生成行を作成する場合、その行のプロパティを基に AutoGeneratedFieldProperties オブジェクト作成し、CreateAutoGeneratedRow メソッド渡します同様に、GridView コントロールは、自動生成列を作成する際、AutoGeneratedFieldProperties オブジェクトを CreateAutoGeneratedColumn メソッド渡します

メモメモ

このクラスは、通常GridView コントロールまたは DetailsView コントロール拡張する場合にのみ使用されます。

DataField プロパティ設定すると、AutoGeneratedField オブジェクトバインドするフィールド名を指定できますフィールド値のデータ型指定するには、Type プロパティ設定します。IsReadOnly プロパティtrue設定すると、ユーザーフィールド値を変更しないようにできますName プロパティ設定すると、AutoGeneratedField オブジェクトに名前を付けることもできます

使用例使用例

AutoGeneratedFieldProperties クラス使用してDetailsView コントロールか派生したカスタム コントロールAutoGeneratedField オブジェクト作成する方法次のコード例示します

Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Security.Permissions
Imports System.Web

Namespace Samples.AspNet.VB.Controls

    <AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal),
 AspNetHostingPermission(SecurityAction.InheritanceDemand, Level:=AspNetHostingPermissionLevel.Minimal)>
 Public Class SimpleCustomControl
        Inherits System.Web.UI.WebControls.DetailsView

        Protected Overrides Function
 CreateAutoGeneratedRow(ByVal fieldProperties As
 AutoGeneratedFieldProperties) As AutoGeneratedField

            ' Create an AutoGeneratedField object.
            Dim field As New
 AutoGeneratedField(fieldProperties.DataField)

            ' Set the properties of the AutoGeneratedField using
            ' the values from the AutoGeneratedFieldProperties 
            ' object contained in the fieldProperties parameter.
            CType(field, IStateManager).TrackViewState()
            field.HeaderText = fieldProperties.Name
            field.SortExpression = fieldProperties.Name
            field.ReadOnly = fieldProperties.IsReadOnly
            field.DataType = fieldProperties.Type

            Return field

        End Function

    End Class

End Namespace

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Security.Permissions;
using System.Web;

namespace Samples.AspNet.CS.Controls
{
      
    [AspNetHostingPermission(SecurityAction.Demand, Level=AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
    public class SimpleCustomControl : DetailsView
    {

        protected override AutoGeneratedField CreateAutoGeneratedRow(AutoGeneratedFieldProperties
 fieldProperties) 
        {

            // Create an AutoGeneratedField object.
            AutoGeneratedField field = new AutoGeneratedField(fieldProperties.DataField);

            // Set the properties of the AutoGeneratedField using
            // the values from the AutoGeneratedFieldProperties 
            // object contained in the fieldProperties parameter.
            ((IStateManager)field).TrackViewState();
            field.HeaderText = fieldProperties.Name;
            field.SortExpression = fieldProperties.Name;
            field.ReadOnly = fieldProperties.IsReadOnly;
            field.DataType = fieldProperties.Type;

            return field;
        }
        
    }
}

.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
  System.Web.UI.WebControls.AutoGeneratedFieldProperties
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
AutoGeneratedFieldProperties メンバ
System.Web.UI.WebControls 名前空間
AutoGeneratedFieldProperties クラス
CreateAutoGeneratedRow
CreateAutoGeneratedColumn
DataField
IsReadOnly
Name
Type



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「AutoGeneratedFieldProperties クラス」の関連用語

AutoGeneratedFieldProperties クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



AutoGeneratedFieldProperties クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS