DataGridTextBoxColumn クラス

定義

文字列の編集に使用する、TextBox のセル内の DataGridColumnStyle コントロールをホストします。

public ref class DataGridTextBoxColumn : System::Windows::Forms::DataGridColumnStyle
public class DataGridTextBoxColumn : System.Windows.Forms.DataGridColumnStyle
type DataGridTextBoxColumn = class
    inherit DataGridColumnStyle
Public Class DataGridTextBoxColumn
Inherits DataGridColumnStyle
継承

次の例では、 をDataGridTextBoxColumn作成し、 の DataGridGridColumnStylesCollection追加します。 このコード例を実行するには、 という名前dataGrid1のフォームDataGridに貼り付け、 のFormコンストラクターから呼び出します。

private:
   void AddColumn()
   {
      DataTable^ myTable = gcnew DataTable;
      
      // Add a new DataColumn to the DataTable.
      DataColumn^ myColumn = gcnew DataColumn( "myTextBoxColumn" );
      myColumn->DataType = System::Type::GetType( "System::String" );
      myColumn->DefaultValue = "default string";
      myTable->Columns->Add( myColumn );
      
      // Get the CurrencyManager for the DataTable.
      CurrencyManager^ cm = dynamic_cast<CurrencyManager^>(this->BindingContext[ myTable ]);
      
      // Use the CurrencyManager to get the PropertyDescriptor for the new column.
      System::ComponentModel::PropertyDescriptor^ pd = cm->GetItemProperties()[ "myTextBoxColumn" ];
      DataGridTextBoxColumn^ myColumnTextColumn;
      
      // Create the DataGridTextBoxColumn with the PropertyDescriptor.
      myColumnTextColumn = gcnew DataGridTextBoxColumn( pd );
      
      // Add the new DataGridColumn to the GridColumnsCollection.
      dataGrid1->DataSource = myTable;
      dataGrid1->TableStyles->Add( gcnew DataGridTableStyle );
      dataGrid1->TableStyles[ 0 ]->GridColumnStyles->Add( myColumnTextColumn );
   }
private void AddColumn()
{
     DataTable myTable= new DataTable();
 
     // Add a new DataColumn to the DataTable.
     DataColumn myColumn = new DataColumn("myTextBoxColumn");
     myColumn.DataType = System.Type.GetType("System.String");
     myColumn.DefaultValue="default string";
     myTable.Columns.Add(myColumn);
     // Get the CurrencyManager for the DataTable.
     CurrencyManager cm = (CurrencyManager)this.BindingContext[myTable];
     // Use the CurrencyManager to get the PropertyDescriptor for the new column.
     PropertyDescriptor pd = cm.GetItemProperties()["myTextBoxColumn"];
     DataGridTextBoxColumn myColumnTextColumn;
     // Create the DataGridTextBoxColumn with the PropertyDescriptor.
     myColumnTextColumn = new DataGridTextBoxColumn(pd);
     // Add the new DataGridColumn to the GridColumnsCollection.
     dataGrid1.DataSource= myTable;
     dataGrid1.TableStyles.Add(new DataGridTableStyle());
     dataGrid1.TableStyles[0].GridColumnStyles.Add(myColumnTextColumn);
 }
Private Sub AddColumn()
    Dim myTable As New DataTable()
    
    ' Add a new DataColumn to the DataTable.
    Dim myColumn As New DataColumn("myTextBoxColumn")
    myColumn.DataType = System.Type.GetType("System.String")
    myColumn.DefaultValue = "default string"
    myTable.Columns.Add(myColumn)
    ' Get the CurrencyManager for the DataTable.
    Dim cm As CurrencyManager = CType(Me.BindingContext(myTable), CurrencyManager)
    ' Use the CurrencyManager to get the PropertyDescriptor for the new column.
    Dim pd As PropertyDescriptor = cm.GetItemProperties()("myTextBoxColumn")
    Dim myColumnTextColumn As DataGridTextBoxColumn
    ' Create the DataGridTextBoxColumn with the PropertyDescriptor.
    myColumnTextColumn = New DataGridTextBoxColumn(pd)
    ' Add the new DataGridColumn to the GridColumnsCollection.
    dataGrid1.DataSource = myTable
    dataGrid1.TableStyles.Add(New DataGridTableStyle())
    dataGrid1.TableStyles(0).GridColumnStyles.Add(myColumnTextColumn)
End Sub

注釈

クラスはDataGridTextBoxColumn、 クラス DataGridColumnStyleからabstract派生します。 実行時に、 は DataGridTextBoxColumn 、ユーザーがテキストを DataGridTextBox 編集できるようにするコントロールをホストします。

クラスに追加される特別なプロパティには、 と がHideEditBox含まれますFormat。 これらのプロパティを使用すると、ホストされているコントロールとその属性に DataGridTextBox アクセスし、値を表示するための形式を設定できます。

データ ソースがオブジェクトを DataTable 格納している DataColumn 場合は、 DataTypeDataColumn プロパティを、テキスト ボックス コントロールで論理的に編集できるデータ型に設定する必要があります。 次のデータ型は、および に自動的に関連付けられます DateTimeDoubleInt16Int32Int64UInt16DataGridTextBoxColumnUInt64UInt32DecimalByteSingleString

Note

Visual Basic DateTimeUInt64UInt16UInt32では、および TimeSpanの各型は完全にはサポートされていません。 (演算子は使用できません。

コンストラクター

DataGridTextBoxColumn()

DataGridTextBoxColumn クラスの新しいインスタンスを初期化します。

DataGridTextBoxColumn(PropertyDescriptor)

指定した を使用して、 クラスの DataGridTextBoxColumn 新しいインスタンスを初期化します PropertyDescriptor

DataGridTextBoxColumn(PropertyDescriptor, Boolean)

指定した PropertyDescriptor を使用して DataGridTextBoxColumn クラスの新しいインスタンスを初期化します。 DataGridTextBoxColumn が既定の列かどうかを指定します。

DataGridTextBoxColumn(PropertyDescriptor, String)

指定した PropertyDescriptor および 形式を使用して、 DataGridTextBoxColumn クラスの新しいインスタンスを初期化します。

DataGridTextBoxColumn(PropertyDescriptor, String, Boolean)

指定した DataGridTextBoxColumn と書式を使用して、PropertyDescriptor クラスの新しいインスタンスを初期化します。 列が既定の列かどうかを指定します。

プロパティ

Alignment

列内のテキストの配置について値を取得または設定します。

(継承元 DataGridColumnStyle)
CanRaiseEvents

コンポーネントがイベントを発生させることがきるかどうかを示す値を取得します。

(継承元 Component)
Container

IContainer を含む Component を取得します。

(継承元 Component)
DataGridTableStyle

列の DataGridTableStyle を取得します。

(継承元 DataGridColumnStyle)
DesignMode

Component が現在デザイン モードかどうかを示す値を取得します。

(継承元 Component)
Events

Component に結び付けられているイベント ハンドラーのリストを取得します。

(継承元 Component)
FontHeight

列のフォントの高さを取得します。

(継承元 DataGridColumnStyle)
Format

テキストの書式指定方法を指定する 1 文字以上の文字を取得または設定します。

FormatInfo

値の書式指定方法を決定するために使用する、カルチャ固有の情報を取得または設定します。

HeaderAccessibleObject

列の AccessibleObject を取得します。

(継承元 DataGridColumnStyle)
HeaderText

列ヘッダーのテキストを取得または設定します。

(継承元 DataGridColumnStyle)
MappingName

列スタイルの割り当て先のデータ メンバーの名前を取得または設定します。

(継承元 DataGridColumnStyle)
NullText

列が null を格納している場合に表示されるテキストを取得または設定します。

(継承元 DataGridColumnStyle)
PropertyDescriptor

PropertyDescriptorDataGridTextBoxColumn を取得または設定します。

ReadOnly

テキスト ボックスの列が読み取り専用かどうかを示す値を設定します。

Site

ComponentISite を取得または設定します。

(継承元 Component)
TextBox

ホストされている TextBox コントロールを取得します。

Width

列の幅を取得または設定します。

(継承元 DataGridColumnStyle)

メソッド

Abort(Int32)

編集プロシージャを中断する要求を実行します。

BeginUpdate()

EndUpdate() メソッドが呼び出されるまで、列の描画を中断します。

(継承元 DataGridColumnStyle)
CheckValidDataSource(CurrencyManager)

DataGrid が有効なデータ ソースを保持していない場合、またはこの列がデータ ソースの有効なプロパティにマップされていない場合は、例外がスローされます。

(継承元 DataGridColumnStyle)
ColumnStartedEditing(Control)

ユーザーが列の編集を開始したことを DataGrid に通知します。

(継承元 DataGridColumnStyle)
Commit(CurrencyManager, Int32)

編集プロシージャを完了する要求を実行します。

ConcedeFocus()

フォーカスが与えられたことを列に通知します。

CreateHeaderAccessibleObject()

列の AccessibleObject を取得します。

(継承元 DataGridColumnStyle)
CreateObjRef(Type)

リモート オブジェクトとの通信に使用するプロキシの生成に必要な情報をすべて格納しているオブジェクトを作成します。

(継承元 MarshalByRefObject)
Dispose()

Component によって使用されているすべてのリソースを解放します。

(継承元 Component)
Dispose(Boolean)

Component によって使用されているアンマネージド リソースを解放し、オプションでマネージド リソースも解放します。

(継承元 Component)
Edit(CurrencyManager, Int32, Rectangle, Boolean)

編集するためにセルを準備します。

(継承元 DataGridColumnStyle)
Edit(CurrencyManager, Int32, Rectangle, Boolean, String)

指定した CurrencyManager、行番号、および Rectangle パラメーターを使用して、編集するためにセルを準備します。

(継承元 DataGridColumnStyle)
Edit(CurrencyManager, Int32, Rectangle, Boolean, String, Boolean)

編集するためにセルを準備します。

EndEdit()

DataGridColumnStyle の編集操作を終了します。

EndUpdate()

BeginUpdate() メソッドを呼び出して中断されていた列の描画を再開します。

(継承元 DataGridColumnStyle)
EnterNullValue()

Value を列に入力します。

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetColumnValueAtRow(CurrencyManager, Int32)

指定した CurrencyManager から、指定した行の値を取得します。

(継承元 DataGridColumnStyle)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetLifetimeService()
古い.

対象のインスタンスの有効期間ポリシーを制御する、現在の有効期間サービス オブジェクトを取得します。

(継承元 MarshalByRefObject)
GetMinimumHeight()

DataGridColumnStyle のセルの高さを取得します。

GetPreferredHeight(Graphics, Object)

列のサイズを自動的に変更するために使用する高さを取得します。

GetPreferredSize(Graphics, Object)

指定した値を基準にして、指定した行のセルの最適な幅および高さを返します。

GetService(Type)

Component またはその Container で提供されるサービスを表すオブジェクトを返します。

(継承元 Component)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
HideEditBox()

DataGridTextBox コントロールを非表示にして、フォーカスを DataGrid コントロールに移します。

InitializeLifetimeService()
古い.

このインスタンスの有効期間ポリシーを制御する有効期間サービス オブジェクトを取得します。

(継承元 MarshalByRefObject)
Invalidate()

列を再描画し、描画メッセージがコントロールに送信されます。

(継承元 DataGridColumnStyle)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
MemberwiseClone(Boolean)

現在の MarshalByRefObject オブジェクトの簡易コピーを作成します。

(継承元 MarshalByRefObject)
Paint(Graphics, Rectangle, CurrencyManager, Int32)

指定した DataGridColumnStyleGraphicsRectangle、および行番号を使用して CurrencyManager を描画します。

Paint(Graphics, Rectangle, CurrencyManager, Int32, Boolean)

指定した DataGridColumnStyleGraphicsRectangle、行番号、および配置を使用して CurrencyManager を描画します。

Paint(Graphics, Rectangle, CurrencyManager, Int32, Brush, Brush, Boolean)

指定した DataGridColumnStyleGraphicsRectangle、行番号、CurrencyManager、および前景色を使用して Brush を描画します。

PaintText(Graphics, Rectangle, String, Boolean)

指定した位置に、テキストと四角形を指定した配置で描画します。

PaintText(Graphics, Rectangle, String, Brush, Brush, Boolean)

指定した位置に、テキストと四角形を指定した色と配置で描画します。

ReleaseHostedControl()

DataGrid が保持している、データの編集に使用されるコントロールへの参照を削除します。

ResetHeaderText()

HeaderText を既定値 null にリセットします。

(継承元 DataGridColumnStyle)
SetColumnValueAtRow(CurrencyManager, Int32, Object)

指定した CurrencyManager からの値を使用して、指定した行の値を設定します。

(継承元 DataGridColumnStyle)
SetDataGrid(DataGrid)

この列が属する DataGrid コントロールを設定します。

(継承元 DataGridColumnStyle)
SetDataGridInColumn(DataGrid)

TextBox コントロールを DataGrid コントロールの Control.ControlCollection に追加します。

ToString()

Component の名前 (存在する場合) を格納する String を返します。 このメソッドはオーバーライドできません。

(継承元 Component)
UpdateUI(CurrencyManager, Int32, String)

ユーザー インターフェイスを更新します。

イベント

AlignmentChanged

Alignment プロパティの値が変化すると発生します。

(継承元 DataGridColumnStyle)
Disposed

Dispose() メソッドの呼び出しによってコンポーネントが破棄されるときに発生します。

(継承元 Component)
FontChanged

列のフォントが変更されたときに発生します。

(継承元 DataGridColumnStyle)
HeaderTextChanged

HeaderText プロパティの値が変化すると発生します。

(継承元 DataGridColumnStyle)
MappingNameChanged

MappingName 値が変更されたときに発生します。

(継承元 DataGridColumnStyle)
NullTextChanged

NullText 値が変更されたときに発生します。

(継承元 DataGridColumnStyle)
PropertyDescriptorChanged

PropertyDescriptor プロパティの値が変化すると発生します。

(継承元 DataGridColumnStyle)
ReadOnlyChanged

ReadOnly プロパティの値が変化すると発生します。

(継承元 DataGridColumnStyle)
WidthChanged

Width プロパティの値が変化すると発生します。

(継承元 DataGridColumnStyle)

明示的なインターフェイスの実装

IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing(Control)

ユーザーが列の編集を開始したことを DataGrid コントロールに通知します。

(継承元 DataGridColumnStyle)

適用対象

こちらもご覧ください