DataGridColumnStyle DataGridColumnStyle DataGridColumnStyle DataGridColumnStyle Class

정의

DataGrid 컨트롤 열의 모양, 텍스트 형식 및 동작을 지정합니다.Specifies the appearance, text formatting, and behavior of a DataGrid control column. 이 클래스는 추상 클래스입니다.This class is abstract.

public ref class DataGridColumnStyle abstract : System::ComponentModel::Component, System::Windows::Forms::IDataGridColumnStyleEditingNotificationService
public abstract class DataGridColumnStyle : System.ComponentModel.Component, System.Windows.Forms.IDataGridColumnStyleEditingNotificationService
type DataGridColumnStyle = class
    inherit Component
    interface IDataGridColumnStyleEditingNotificationService
Public MustInherit Class DataGridColumnStyle
Inherits Component
Implements IDataGridColumnStyleEditingNotificationService
상속
파생
구현

예제

다음 코드 예제에서는 DataGridColumnStyle 호스팅하는 DateTimePicker 제어 합니다.The following code example creates a DataGridColumnStyle that hosts a DateTimePicker control.

#using <System.dll>
#using <System.Data.dll>
#using <System.Drawing.dll>
#using <System.Windows.Forms.dll>
#using <System.Xml.dll>

using namespace System;
using namespace System::Data;
using namespace System::Windows::Forms;
using namespace System::Drawing;
using namespace System::Security::Permissions;

// This example shows how to create your own column style that
// hosts a control, in this case, a DateTimePicker.

public ref class CustomDateTimePicker : public DateTimePicker
{
protected:
    [SecurityPermission(SecurityAction::Demand, Flags=SecurityPermissionFlag::UnmanagedCode)]
    virtual bool ProcessKeyMessage( Message% m ) override
    {
        // Keep all the keys for the DateTimePicker.
        return ProcessKeyEventArgs( m );
    }
};

public ref class DataGridTimePickerColumn : public DataGridColumnStyle
{
private:
   CustomDateTimePicker^ customDateTimePicker1;

   // The isEditing field tracks whether or not the user is
   // editing data with the hosted control.
   bool isEditing;

public:
   DataGridTimePickerColumn()
   {
      customDateTimePicker1 = gcnew CustomDateTimePicker;
      customDateTimePicker1->Visible = false;
   }

protected:
   virtual void Abort( int /*rowNum*/ ) override
   {
      isEditing = false;
      customDateTimePicker1->ValueChanged -=
         gcnew EventHandler( this, &DataGridTimePickerColumn::TimePickerValueChanged );
      Invalidate();
   }

   virtual bool Commit( CurrencyManager^ dataSource, int rowNum ) override
   {
      customDateTimePicker1->Bounds = Rectangle::Empty;

      customDateTimePicker1->ValueChanged -=
         gcnew EventHandler( this, &DataGridTimePickerColumn::TimePickerValueChanged );
      
      if (  !isEditing )
         return true;

      isEditing = false;

      try
      {
         DateTime value = customDateTimePicker1->Value;
         SetColumnValueAtRow( dataSource, rowNum, value );
      }
      catch ( Exception^ ) 
      {
         Abort( rowNum );
         return false;
      }

      Invalidate();
      return true;
   }

   virtual void Edit(
      CurrencyManager^ source,
      int rowNum,
      Rectangle bounds,
      bool /*readOnly*/,
      String^ /*displayText*/,
      bool cellIsVisible ) override
   {
      DateTime value =  (DateTime)
         GetColumnValueAtRow( source, rowNum );
      if ( cellIsVisible )
      {
         customDateTimePicker1->Bounds = Rectangle(
            bounds.X + 2, bounds.Y + 2,
            bounds.Width - 4, bounds.Height - 4 );
         customDateTimePicker1->Value = value;
         customDateTimePicker1->Visible = true;
         customDateTimePicker1->ValueChanged +=
            gcnew EventHandler( this, &DataGridTimePickerColumn::TimePickerValueChanged );
      }
      else
      {
         customDateTimePicker1->Value = value;
         customDateTimePicker1->Visible = false;
      }

      if ( customDateTimePicker1->Visible )
         DataGridTableStyle->DataGrid->Invalidate( bounds );

      customDateTimePicker1->Focus();
   }

   virtual System::Drawing::Size GetPreferredSize(
      Graphics^ /*g*/,
      Object^ /*value*/ ) override
   {
      return Size( 100, customDateTimePicker1->PreferredHeight + 4);
   }

   virtual int GetMinimumHeight() override
   {
      return customDateTimePicker1->PreferredHeight + 4;
   }

   virtual int GetPreferredHeight( Graphics^ /*g*/,
      Object^ /*value*/ ) override
   {
      return customDateTimePicker1->PreferredHeight + 4;
   }

   virtual void Paint( Graphics^ g,
      Rectangle bounds,
      CurrencyManager^ source,
      int rowNum ) override
   {
      Paint( g, bounds, source, rowNum, false );
   }

   virtual void Paint(
      Graphics^ g,
      Rectangle bounds,
      CurrencyManager^ source,
      int rowNum,
      bool alignToRight ) override
   {
      Paint(
         g, bounds,
         source,
         rowNum,
         Brushes::Red,
         Brushes::Blue,
         alignToRight );
   }

   virtual void Paint(
      Graphics^ g,
      Rectangle bounds,
      CurrencyManager^ source,
      int rowNum,
      Brush^ backBrush,
      Brush^ foreBrush,
      bool /*alignToRight*/ ) override
   {
      DateTime date =  (DateTime)
         GetColumnValueAtRow( source, rowNum );
      Rectangle rect = bounds;
      g->FillRectangle( backBrush, rect );
      rect.Offset( 0, 2 );
      rect.Height -= 2;
      g->DrawString( date.ToString( "d" ),
         this->DataGridTableStyle->DataGrid->Font,
         foreBrush, rect );
   }

   virtual void SetDataGridInColumn( DataGrid^ value ) override
   {
      DataGridColumnStyle::SetDataGridInColumn( value );
      if ( customDateTimePicker1->Parent != nullptr )
      {
         customDateTimePicker1->Parent->Controls->Remove
            ( customDateTimePicker1 );
      }
      if ( value != nullptr )
      {
         value->Controls->Add( customDateTimePicker1 );
      }
   }

private:
   void TimePickerValueChanged( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // Remove the handler to prevent it from being called twice in a row.
      customDateTimePicker1->ValueChanged -=
         gcnew EventHandler( this, &DataGridTimePickerColumn::TimePickerValueChanged );
      this->isEditing = true;
      DataGridColumnStyle::ColumnStartedEditing( customDateTimePicker1 );
   }
};

public ref class MyForm: public Form
{
private:
   DataTable^ namesDataTable;
   DataGrid^ grid;
public:
   MyForm()
   {
      grid = gcnew DataGrid;

      InitForm();

      namesDataTable = gcnew DataTable( "NamesTable" );
      namesDataTable->Columns->Add( gcnew DataColumn( "Name" ) );
      DataColumn^ dateColumn = gcnew DataColumn
         ( "Date",DateTime::typeid );
      dateColumn->DefaultValue = DateTime::Today;
      namesDataTable->Columns->Add( dateColumn );
      DataSet^ namesDataSet = gcnew DataSet;
      namesDataSet->Tables->Add( namesDataTable );
      grid->DataSource = namesDataSet;
      grid->DataMember = "NamesTable";
      AddGridStyle();
      AddData();
   }

private:
   void AddGridStyle()
   {
      DataGridTableStyle^ myGridStyle = gcnew DataGridTableStyle;
      myGridStyle->MappingName = "NamesTable";
      DataGridTextBoxColumn^ nameColumnStyle =
         gcnew DataGridTextBoxColumn;
      nameColumnStyle->MappingName = "Name";
      nameColumnStyle->HeaderText = "Name";
      myGridStyle->GridColumnStyles->Add( nameColumnStyle );

      DataGridTimePickerColumn^ timePickerColumnStyle =
         gcnew DataGridTimePickerColumn;
      timePickerColumnStyle->MappingName = "Date";
      timePickerColumnStyle->HeaderText = "Date";
      timePickerColumnStyle->Width = 100;
      myGridStyle->GridColumnStyles->Add( timePickerColumnStyle );

      grid->TableStyles->Add( myGridStyle );
   }

   void AddData()
   {
      DataRow^ dRow = namesDataTable->NewRow();
      dRow->default[ "Name" ] = "Name 1";
      dRow->default[ "Date" ] = DateTime(2001,12,01);
      namesDataTable->Rows->Add( dRow );

      dRow = namesDataTable->NewRow();
      dRow->default[ "Name" ] = "Name 2";
      dRow->default[ "Date" ] = DateTime(2001,12,04);
      namesDataTable->Rows->Add( dRow );

      dRow = namesDataTable->NewRow();
      dRow->default[ "Name" ] = "Name 3";
      dRow->default[ "Date" ] = DateTime(2001,12,29);
      namesDataTable->Rows->Add( dRow );

      dRow = namesDataTable->NewRow();
      dRow->default[ "Name" ] = "Name 4";
      dRow->default[ "Date" ] = DateTime(2001,12,13);
      namesDataTable->Rows->Add( dRow );

      dRow = namesDataTable->NewRow();
      dRow->default[ "Name" ] = "Name 5";
      dRow->default[ "Date" ] = DateTime(2001,12,21);
      namesDataTable->Rows->Add( dRow );

      namesDataTable->AcceptChanges();
   }

   void InitForm()
   {
      this->Size = System::Drawing::Size( 500, 500 );
      grid->Size = System::Drawing::Size( 350, 250 );
      grid->TabStop = true;
      grid->TabIndex = 1;
      this->StartPosition = FormStartPosition::CenterScreen;
      this->Controls->Add( grid );
   }
};

[STAThread]
int main()
{
   Application::Run( gcnew MyForm );
}
using System;
using System.Data;
using System.Windows.Forms;
using System.Drawing;
using System.Security.Permissions;

// This example shows how to create your own column style that
// hosts a control, in this case, a DateTimePicker.
public class DataGridTimePickerColumn : DataGridColumnStyle
{
    private CustomDateTimePicker customDateTimePicker1 = 
        new CustomDateTimePicker();

    // The isEditing field tracks whether or not the user is
    // editing data with the hosted control.
    private bool isEditing;

    public DataGridTimePickerColumn() : base()
    {
        customDateTimePicker1.Visible = false;
    }

    protected override void Abort(int rowNum)
    {
        isEditing = false;
        customDateTimePicker1.ValueChanged -=
            new EventHandler(TimePickerValueChanged);
        Invalidate();
    }

    protected override bool Commit
        (CurrencyManager dataSource, int rowNum)
    {
        customDateTimePicker1.Bounds = Rectangle.Empty;

        customDateTimePicker1.ValueChanged -=
            new EventHandler(TimePickerValueChanged);

        if (!isEditing)
            return true;

        isEditing = false;

        try
        {
            DateTime value = customDateTimePicker1.Value;
            SetColumnValueAtRow(dataSource, rowNum, value);
        }
        catch (Exception)
        {
            Abort(rowNum);
            return false;
        }

        Invalidate();
        return true;
    }

    protected override void Edit(
        CurrencyManager source,
        int rowNum,
        Rectangle bounds,
        bool readOnly,
        string displayText,
        bool cellIsVisible)
    {
        DateTime value = (DateTime)
            GetColumnValueAtRow(source, rowNum);
        if (cellIsVisible)
        {
            customDateTimePicker1.Bounds = new Rectangle
                (bounds.X + 2, bounds.Y + 2,
                bounds.Width - 4, bounds.Height - 4);
            customDateTimePicker1.Value = value;
            customDateTimePicker1.Visible = true;
            customDateTimePicker1.ValueChanged +=
                new EventHandler(TimePickerValueChanged);
        }
        else
        {
            customDateTimePicker1.Value = value;
            customDateTimePicker1.Visible = false;
        }

        if (customDateTimePicker1.Visible)
            DataGridTableStyle.DataGrid.Invalidate(bounds);

        customDateTimePicker1.Focus();
    }

    protected override Size GetPreferredSize(
        Graphics g,
        object value)
    {
        return new Size(100, customDateTimePicker1.PreferredHeight + 4);
    }

    protected override int GetMinimumHeight()
    {
        return customDateTimePicker1.PreferredHeight + 4;
    }

    protected override int GetPreferredHeight(Graphics g,
        object value)
    {
        return customDateTimePicker1.PreferredHeight + 4;
    }

    protected override void Paint(Graphics g,
        Rectangle bounds,
        CurrencyManager source,
        int rowNum)
    {
        Paint(g, bounds, source, rowNum, false);
    }

    protected override void Paint(
        Graphics g,
        Rectangle bounds,
        CurrencyManager source,
        int rowNum,
        bool alignToRight)
    {
        Paint(
            g, bounds,
            source,
            rowNum,
            Brushes.Red,
            Brushes.Blue,
            alignToRight);
    }

    protected override void Paint(
        Graphics g,
        Rectangle bounds,
        CurrencyManager source,
        int rowNum,
        Brush backBrush,
        Brush foreBrush,
        bool alignToRight)
    {
        DateTime date = (DateTime)
            GetColumnValueAtRow(source, rowNum);
        Rectangle rect = bounds;
        g.FillRectangle(backBrush, rect);
        rect.Offset(0, 2);
        rect.Height -= 2;
        g.DrawString(date.ToString("d"),
            this.DataGridTableStyle.DataGrid.Font,
            foreBrush, rect);
    }

    protected override void SetDataGridInColumn(DataGrid value)
    {
        base.SetDataGridInColumn(value);
        if (customDateTimePicker1.Parent != null)
        {
            customDateTimePicker1.Parent.Controls.Remove
                (customDateTimePicker1);
        }
        if (value != null)
        {
            value.Controls.Add(customDateTimePicker1);
        }
    }

    private void TimePickerValueChanged(object sender, EventArgs e)
    {
        // Remove the handler to prevent it from being called twice in a row.
        customDateTimePicker1.ValueChanged -=
            new EventHandler(TimePickerValueChanged);
        this.isEditing = true;
        base.ColumnStartedEditing(customDateTimePicker1);
    }
}

public class CustomDateTimePicker : DateTimePicker
{
    [SecurityPermissionAttribute(
    SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)]
    protected override bool ProcessKeyMessage(ref Message m)
    {
        // Keep all the keys for the DateTimePicker.
        return ProcessKeyEventArgs(ref m);
    }
}

public class MyForm : Form
{
    private DataTable namesDataTable;
    private DataGrid grid = new DataGrid();
    public MyForm() : base()
    {
        InitForm();

        namesDataTable = new DataTable("NamesTable");
        namesDataTable.Columns.Add(new DataColumn("Name"));
        DataColumn dateColumn = new DataColumn
            ("Date", typeof(DateTime));
        dateColumn.DefaultValue = DateTime.Today;
        namesDataTable.Columns.Add(dateColumn);
        DataSet namesDataSet = new DataSet();
        namesDataSet.Tables.Add(namesDataTable);
        grid.DataSource = namesDataSet;
        grid.DataMember = "NamesTable";
        AddGridStyle();
        AddData();
    }

    private void AddGridStyle()
    {
        DataGridTableStyle myGridStyle = new DataGridTableStyle();
        myGridStyle.MappingName = "NamesTable";

        DataGridTextBoxColumn nameColumnStyle =
            new DataGridTextBoxColumn();
        nameColumnStyle.MappingName = "Name";
        nameColumnStyle.HeaderText = "Name";
        myGridStyle.GridColumnStyles.Add(nameColumnStyle);

        DataGridTimePickerColumn timePickerColumnStyle =
            new DataGridTimePickerColumn();
        timePickerColumnStyle.MappingName = "Date";
        timePickerColumnStyle.HeaderText = "Date";
        timePickerColumnStyle.Width = 100;
        myGridStyle.GridColumnStyles.Add(timePickerColumnStyle);

        grid.TableStyles.Add(myGridStyle);
    }

    private void AddData()
    {

        DataRow dRow = namesDataTable.NewRow();
        dRow["Name"] = "Name 1";
        dRow["Date"] = new DateTime(2001, 12, 01);
        namesDataTable.Rows.Add(dRow);

        dRow = namesDataTable.NewRow();
        dRow["Name"] = "Name 2";
        dRow["Date"] = new DateTime(2001, 12, 04);
        namesDataTable.Rows.Add(dRow);

        dRow = namesDataTable.NewRow();
        dRow["Name"] = "Name 3";
        dRow["Date"] = new DateTime(2001, 12, 29);
        namesDataTable.Rows.Add(dRow);

        dRow = namesDataTable.NewRow();
        dRow["Name"] = "Name 4";
        dRow["Date"] = new DateTime(2001, 12, 13);
        namesDataTable.Rows.Add(dRow);

        dRow = namesDataTable.NewRow();
        dRow["Name"] = "Name 5";
        dRow["Date"] = new DateTime(2001, 12, 21);
        namesDataTable.Rows.Add(dRow);

        namesDataTable.AcceptChanges();
    }

    private void InitForm()
    {
        this.Size = new Size(500, 500);
        grid.Size = new Size(350, 250);
        grid.TabStop = true;
        grid.TabIndex = 1;
        this.StartPosition = FormStartPosition.CenterScreen;
        this.Controls.Add(grid);
    }
 
    [STAThread]
    public static void Main()
    {
        Application.Run(new MyForm());
    }
}
Imports System
Imports System.Data
Imports System.Windows.Forms
Imports System.Drawing
Imports System.ComponentModel
Imports System.Security.Permissions

' This example shows how to create your own column style that
' hosts a control, in this case, a DateTimePicker.
Public Class DataGridTimePickerColumn
    Inherits DataGridColumnStyle

    Private customDateTimePicker1 As New CustomDateTimePicker()

    ' The isEditing field tracks whether or not the user is
    ' editing data with the hosted control.
    Private isEditing As Boolean

    Public Sub New()
        customDateTimePicker1.Visible = False
    End Sub

    Protected Overrides Sub Abort(ByVal rowNum As Integer)
        isEditing = False
        RemoveHandler customDateTimePicker1.ValueChanged, _
            AddressOf TimePickerValueChanged
        Invalidate()
    End Sub

    Protected Overrides Function Commit _
        (ByVal dataSource As CurrencyManager, ByVal rowNum As Integer) _
        As Boolean

        customDateTimePicker1.Bounds = Rectangle.Empty

        RemoveHandler customDateTimePicker1.ValueChanged, _
            AddressOf TimePickerValueChanged

        If Not isEditing Then
            Return True
        End If
        isEditing = False

        Try
            Dim value As DateTime = customDateTimePicker1.Value
            SetColumnValueAtRow(dataSource, rowNum, value)
        Catch
        End Try

        Invalidate()
        Return True
    End Function

    Protected Overloads Overrides Sub Edit( _
        ByVal [source] As CurrencyManager, _
        ByVal rowNum As Integer, _
        ByVal bounds As Rectangle, _
        ByVal [readOnly] As Boolean, _
        ByVal displayText As String, _
        ByVal cellIsVisible As Boolean)

        Dim value As DateTime = _
        CType(GetColumnValueAtRow([source], rowNum), DateTime)
        If cellIsVisible Then
            customDateTimePicker1.Bounds = New Rectangle _
            (bounds.X + 2, bounds.Y + 2, bounds.Width - 4, _
            bounds.Height - 4)

            customDateTimePicker1.Value = value
            customDateTimePicker1.Visible = True
            AddHandler customDateTimePicker1.ValueChanged, _
            AddressOf TimePickerValueChanged
        Else
            customDateTimePicker1.Value = value
            customDateTimePicker1.Visible = False
        End If

        If customDateTimePicker1.Visible Then
            DataGridTableStyle.DataGrid.Invalidate(bounds)
        End If

        customDateTimePicker1.Focus()

    End Sub

    Protected Overrides Function GetPreferredSize( _
        ByVal g As Graphics, _
        ByVal value As Object) As Size

        Return New Size(100, customDateTimePicker1.PreferredHeight + 4)

    End Function

    Protected Overrides Function GetMinimumHeight() As Integer
        Return customDateTimePicker1.PreferredHeight + 4
    End Function

    Protected Overrides Function GetPreferredHeight( _
        ByVal g As Graphics, ByVal value As Object) As Integer

        Return customDateTimePicker1.PreferredHeight + 4

    End Function

    Protected Overloads Overrides Sub Paint( _
        ByVal g As Graphics, ByVal bounds As Rectangle, _
        ByVal [source] As CurrencyManager, ByVal rowNum As Integer)

        Paint(g, bounds, [source], rowNum, False)

    End Sub

    Protected Overloads Overrides Sub Paint(ByVal g As Graphics, _
        ByVal bounds As Rectangle, ByVal [source] As CurrencyManager, _
        ByVal rowNum As Integer, ByVal alignToRight As Boolean)

        Paint(g, bounds, [source], rowNum, Brushes.Red, _
            Brushes.Blue, alignToRight)

    End Sub

    Protected Overloads Overrides Sub Paint(ByVal g As Graphics, _
        ByVal bounds As Rectangle, ByVal [source] As CurrencyManager, _
        ByVal rowNum As Integer, ByVal backBrush As Brush, _
        ByVal foreBrush As Brush, ByVal alignToRight As Boolean)

        Dim [date] As DateTime = _
        CType(GetColumnValueAtRow([source], rowNum), DateTime)
        Dim rect As Rectangle = bounds
        g.FillRectangle(backBrush, rect)
        rect.Offset(0, 2)
        rect.Height -= 2
        g.DrawString([date].ToString("d"), _
            Me.DataGridTableStyle.DataGrid.Font, foreBrush, _
            RectangleF.FromLTRB(rect.X, rect.Y, rect.Right, rect.Bottom))

    End Sub

    Protected Overrides Sub SetDataGridInColumn(ByVal value As DataGrid)
        MyBase.SetDataGridInColumn(value)
        If (customDateTimePicker1.Parent IsNot Nothing) Then
            customDateTimePicker1.Parent.Controls.Remove(customDateTimePicker1)
        End If
        If (value IsNot Nothing) Then
            value.Controls.Add(customDateTimePicker1)
        End If
    End Sub

    Private Sub TimePickerValueChanged( _
        ByVal sender As Object, ByVal e As EventArgs)

        ' Remove the handler to prevent it from being called twice in a row.
        RemoveHandler customDateTimePicker1.ValueChanged, _
            AddressOf TimePickerValueChanged
        Me.isEditing = True
        MyBase.ColumnStartedEditing(customDateTimePicker1)

    End Sub

End Class

Public Class CustomDateTimePicker
    Inherits DateTimePicker

    <SecurityPermissionAttribute( _
    SecurityAction.LinkDemand, Flags := SecurityPermissionFlag.UnmanagedCode)> _
    Protected Overrides Function ProcessKeyMessage(ByRef m As Message) As Boolean
        ' Keep all the keys for the DateTimePicker.
        Return ProcessKeyEventArgs(m)
    End Function

End Class

Public Class MyForm
    Inherits Form

    Private namesDataTable As DataTable
    Private myGrid As DataGrid = New DataGrid()

    Public Sub New()

        InitForm()

        namesDataTable = New DataTable("NamesTable")
        namesDataTable.Columns.Add(New DataColumn("Name"))
        Dim dateColumn As DataColumn = _
             New DataColumn("Date", GetType(DateTime))
        dateColumn.DefaultValue = DateTime.Today
        namesDataTable.Columns.Add(dateColumn)
        Dim namesDataSet As DataSet = New DataSet()
        namesDataSet.Tables.Add(namesDataTable)
        myGrid.DataSource = namesDataSet
        myGrid.DataMember = "NamesTable"
        AddGridStyle()
        AddData()

    End Sub

    Private Sub AddGridStyle()
        Dim myGridStyle As DataGridTableStyle = _
                    New DataGridTableStyle()
        myGridStyle.MappingName = "NamesTable"

        Dim nameColumnStyle As DataGridTextBoxColumn = _
            New DataGridTextBoxColumn()
        nameColumnStyle.MappingName = "Name"
        nameColumnStyle.HeaderText = "Name"
        myGridStyle.GridColumnStyles.Add(nameColumnStyle)

        Dim customDateTimePicker1ColumnStyle As DataGridTimePickerColumn = _
            New DataGridTimePickerColumn()
        customDateTimePicker1ColumnStyle.MappingName = "Date"
        customDateTimePicker1ColumnStyle.HeaderText = "Date"
        customDateTimePicker1ColumnStyle.Width = 100
        myGridStyle.GridColumnStyles.Add(customDateTimePicker1ColumnStyle)

        myGrid.TableStyles.Add(myGridStyle)
    End Sub

    Private Sub AddData()
        Dim dRow As DataRow = namesDataTable.NewRow()
        dRow("Name") = "Name 1"
        dRow("Date") = New DateTime(2001, 12, 1)
        namesDataTable.Rows.Add(dRow)

        dRow = namesDataTable.NewRow()
        dRow("Name") = "Name 2"
        dRow("Date") = New DateTime(2001, 12, 4)
        namesDataTable.Rows.Add(dRow)

        dRow = namesDataTable.NewRow()
        dRow("Name") = "Name 3"
        dRow("Date") = New DateTime(2001, 12, 29)
        namesDataTable.Rows.Add(dRow)

        dRow = namesDataTable.NewRow()
        dRow("Name") = "Name 4"
        dRow("Date") = New DateTime(2001, 12, 13)
        namesDataTable.Rows.Add(dRow)

        dRow = namesDataTable.NewRow()
        dRow("Name") = "Name 5"
        dRow("Date") = New DateTime(2001, 12, 21)
        namesDataTable.Rows.Add(dRow)

        namesDataTable.AcceptChanges()
    End Sub

    Private Sub InitForm()
        Me.Size = New Size(500, 500)
        myGrid.Size = New Size(350, 250)
        myGrid.TabStop = True
        myGrid.TabIndex = 1
        Me.StartPosition = FormStartPosition.CenterScreen
        Me.Controls.Add(myGrid)
    End Sub

    <STAThread()> _
    Public Shared Sub Main()
        Application.Run(New MyForm())
    End Sub

End Class

설명

컬렉션 DataGridColumnStyle 개체 (합니다 GridColumnStylesCollection) 통해 액세스 하는 합니다 System.Windows.Forms.DataGrid 컨트롤의 TableStyles 속성입니다.The collection of DataGridColumnStyle objects (the GridColumnStylesCollection) is accessed through the System.Windows.Forms.DataGrid control's TableStyles property.

합니다 System.Windows.Forms.DataGrid 컨트롤의 컬렉션을 자동으로 만듭니다 DataGridColumnStyle 설정한 경우에 대 한 개체는 DataSource 적절 한 데이터 원본에 대 한 속성입니다.The System.Windows.Forms.DataGrid control automatically creates a collection of DataGridColumnStyle objects for you when you set the DataSource property to an appropriate data source. 만든 개체에서 상속 되는 다음 클래스 중 하나의 인스턴스를 실제로 DataGridColumnStyle: DataGridBoolColumn 또는 DataGridTextBoxColumn 클래스입니다.The objects created actually are instances of one of the following classes that inherit from DataGridColumnStyle: DataGridBoolColumn or DataGridTextBoxColumn class.

데이터 표시 형식으로 설정 합니다 Format 의 속성을 DataGridTextBoxColumn 클래스 형식 값 중 하나를 합니다.To format the data display, set the Format property of the DataGridTextBoxColumn class to one of the formatting values. 올바른 형식 지정 값에 대 한 자세한 내용은 참조 하세요. 형식 하 고 사용자 지정 날짜 및 시간 형식 문자열합니다.For more information about valid formatting values, see Formatting Types and Custom Date and Time Format Strings.

사용자의 집합을 만들 수도 있습니다 DataGridColumnStyle 개체에 추가 하 여 GridColumnStylesCollection합니다.You can also create your own set of DataGridColumnStyle objects and add them to the GridColumnStylesCollection. 이렇게 하면 설정 해야 합니다는 MappingName 의 각 열 스타일을 합니다 ColumnNameDataColumn 실제 데이터를 사용 하 여 열의 표시를 동기화 하 합니다.When you do so, you must set the MappingName of each column style to the ColumnName of a DataColumn to synchronize the display of columns with the actual data.

주의

항상 만들기 DataGridColumnStyle 개체에 추가 하는 GridColumnStylesCollection 추가 하기 전에 DataGridTableStyle 개체는 GridTableStylesCollection합니다.Always create DataGridColumnStyle objects and add them to the GridColumnStylesCollection before adding DataGridTableStyle objects to the GridTableStylesCollection. 빈을 추가 하는 경우 DataGridTableStyle 을 올바른 MappingName 컬렉션에 값 DataGridColumnStyle 개체를 자동으로 생성 됩니다.When you add an empty DataGridTableStyle with a valid MappingName value to the collection, DataGridColumnStyle objects are automatically generated for you. 새로 추가 하려고 하면 예외가 throw 될 따라서 DataGridColumnStyle 중복을 사용 하 여 개체 MappingName 값을 GridColumnStylesCollection입니다.Consequently, an exception will be thrown if you try to add new DataGridColumnStyle objects with duplicate MappingName values to the GridColumnStylesCollection.

으로 인스턴스화된 경우 파생된 클래스 중 하나를 System.Windows.Forms.DataGrid 컨트롤을 생성 하는 클래스에 따라 달라 집니다 합니다 DataTypeDataColumn 연관를 DataGridColumnStyle 개체.When one of the derived classes is instantiated by a System.Windows.Forms.DataGrid control, the class created depends on the DataType of the DataColumn associated with the DataGridColumnStyle object. 예를 들어를 DataColumn 사용 하 여 해당 DataType 로 설정 System.Boolean 연관 될는 DataGridBoolColumn합니다.For example, a DataColumn with its DataType set to System.Boolean will be associated with a DataGridBoolColumn. 형식을 확인할 DataGridColumnStyle를 사용 하 여를 GetType 메서드.To determine the type of any DataGridColumnStyle, use the GetType method.

고유한 열 클래스를 만들려면에서 상속할 수 있습니다 DataGridColumnStyle합니다.To create your own column classes, you can inherit from DataGridColumnStyle. 알 수 있듯이 컨트롤을 호스트 하는 특수 열을 만들기 위해이 작업을 수행 하는 것이 좋습니다는 DataGridTextBox 클래스는 호스트는 TextBox 제어 합니다.You might want to do this in order to create special columns that host controls, as exemplified by the DataGridTextBox class, which hosts the TextBox control. 예를 들어 호스트할 수 있습니다는 Image 열에서 그림을 표시할 제어 하거나 열에 고유한 사용자 정의 컨트롤을 호스트를 만들 수 있습니다.For example, you can host an Image control to show pictures in columns, or you can create your own user control to host in the column.

기능을 DataGridColumnStyle 의 혼동 하지 않아야는 DataColumn합니다.The functionality of the DataGridColumnStyle shouldn't be confused with that of the DataColumn. 반면 합니다 DataColumn 속성 및 데이터 테이블의 스키마를 만드는 데 적절 한 메서드를 포함 합니다 DataGridColumnStyle 화면에는 개별 열의 모양과 관련 된 메서드와 속성을 포함 합니다.Whereas the DataColumn contains the properties and methods appropriate to creating a data table's schema, the DataGridColumnStyle contains the properties and methods related to the appearance of an individual column on the screen.

행을 포함 하는 경우는 DBNull.Value, 열에 표시 되는 텍스트를 사용 하 여 설정할 수는 NullText 속성입니다.If a row contains a DBNull.Value, the text displayed in the column can be set with the NullText property.

DataGridColumnStyle 클래스 또한 해당 데이터가 변경 되는 동안 열의 동작을 지정할 수 있습니다.The DataGridColumnStyle class also allows you to specify the behavior of a column while its data is being changed. 합니다 BeginUpdateEndUpdate 메서드 열 그리기를 중에 많은 업데이트는 열의 데이터를 임시로 일시 중단 합니다.The BeginUpdate and EndUpdate methods temporarily suspend the drawing of the column while large updates are being made to the column's data. 이 기능 없이 표의 모든 셀 변경 될 때마다 즉시 그려지므로; 사용자 및 성능 책임 산만 수 있습니다.Without this functionality, every change in every cell of the grid would be immediately drawn; this could be distracting to the user and a performance liability.

몇 가지 메서드를 사용 하면 사용자가 편집할 열의 모니터링 등을 EditCommit 이벤트입니다.Several methods allow monitoring of the column as it is edited by the user, including the Edit and Commit events.

대부분의 속성 및 클래스의 메서드는 열의 모양 제어에 맞게 조정 됩니다.Most of the properties and methods of the class are tailored to controlling a column's appearance. 하지만 몇 가지 예는 GetColumnValueAtRowSetColumnValueAtRow 검토 하 고 지정된 된 셀의 값을 변경할 수 있습니다.But a few, such as the GetColumnValueAtRow and SetColumnValueAtRow allow you to examine and change the value in a specified cell.

상속자 참고

상속 하는 경우 DataGridColumnStyle, 멤버를 재정의 해야 합니다. Abort(Int32), Commit(CurrencyManager, Int32), Edit(CurrencyManager, Int32, Rectangle, Boolean), 및 Paint(Graphics, Rectangle, CurrencyManager, Int32) (두 번).When you inherit from DataGridColumnStyle, you must override the following members: Abort(Int32), Commit(CurrencyManager, Int32), Edit(CurrencyManager, Int32, Rectangle, Boolean), and Paint(Graphics, Rectangle, CurrencyManager, Int32) (twice).

생성자

DataGridColumnStyle() DataGridColumnStyle() DataGridColumnStyle() DataGridColumnStyle()

파생 클래스에서 DataGridColumnStyle 클래스의 새 인스턴스를 초기화합니다.In a derived class, initializes a new instance of the DataGridColumnStyle class.

DataGridColumnStyle(PropertyDescriptor) DataGridColumnStyle(PropertyDescriptor) DataGridColumnStyle(PropertyDescriptor) DataGridColumnStyle(PropertyDescriptor)

지정된 DataGridColumnStyle를 사용하여 PropertyDescriptor 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the DataGridColumnStyle class with the specified PropertyDescriptor.

속성

Alignment Alignment Alignment Alignment

열의 텍스트 맞춤을 가져오거나 설정합니다.Gets or sets the alignment of text in a column.

CanRaiseEvents CanRaiseEvents CanRaiseEvents CanRaiseEvents

구성 요소가 이벤트를 발생시킬 수 있는지 여부를 나타내는 값을 가져옵니다.Gets a value indicating whether the component can raise an event.

(Inherited from Component)
Container Container Container Container

IContainer가 포함된 Component를 가져옵니다.Gets the IContainer that contains the Component.

(Inherited from Component)
DataGridTableStyle DataGridTableStyle DataGridTableStyle DataGridTableStyle

이 열에 대한 DataGridTableStyle를 가져옵니다.Gets the DataGridTableStyle for the column.

DesignMode DesignMode DesignMode DesignMode

Component가 현재 디자인 모드인지 여부를 나타내는 값을 가져옵니다.Gets a value that indicates whether the Component is currently in design mode.

(Inherited from Component)
Events Events Events Events

Component에 연결된 이벤트 처리기의 목록을 가져옵니다.Gets the list of event handlers that are attached to this Component.

(Inherited from Component)
FontHeight FontHeight FontHeight FontHeight

열 글꼴의 높이를 가져옵니다.Gets the height of the column's font.

HeaderAccessibleObject HeaderAccessibleObject HeaderAccessibleObject HeaderAccessibleObject

이 열에 대한 AccessibleObject를 가져옵니다.Gets the AccessibleObject for the column.

HeaderText HeaderText HeaderText HeaderText

열 머리글의 텍스트를 가져오거나 설정합니다.Gets or sets the text of the column header.

MappingName MappingName MappingName MappingName

열 스타일을 매핑할 데이터 멤버의 이름을 가져오거나 설정합니다.Gets or sets the name of the data member to map the column style to.

NullText NullText NullText NullText

열에 null가 들어 있을 때 표시되는 텍스트를 가져오거나 설정합니다.Gets or sets the text that is displayed when the column contains null.

PropertyDescriptor PropertyDescriptor PropertyDescriptor PropertyDescriptor

PropertyDescriptor이 표시하는 데이터의 특성을 결정하는 DataGridColumnStyle을 가져오거나 설정합니다.Gets or sets the PropertyDescriptor that determines the attributes of data displayed by the DataGridColumnStyle.

ReadOnly ReadOnly ReadOnly ReadOnly

열의 데이터를 편집할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.Gets or sets a value indicating whether the data in the column can be edited.

Site Site Site Site

ComponentISite를 가져오거나 설정합니다.Gets or sets the ISite of the Component.

(Inherited from Component)
Width Width Width Width

열의 너비를 가져오거나 설정합니다.Gets or sets the width of the column.

메서드

Abort(Int32) Abort(Int32) Abort(Int32) Abort(Int32)

파생 클래스에서 재정의된 경우 편집 프로시저를 중단하라는 요청을 시작합니다.When overridden in a derived class, initiates a request to interrupt an edit procedure.

BeginUpdate() BeginUpdate() BeginUpdate() BeginUpdate()

EndUpdate() 메서드가 호출될 때까지 열 그리기를 일시 중단합니다.Suspends the painting of the column until the EndUpdate() method is called.

CheckValidDataSource(CurrencyManager) CheckValidDataSource(CurrencyManager) CheckValidDataSource(CurrencyManager) CheckValidDataSource(CurrencyManager)

DataGrid의 데이터 소스가 올바르지 않거나 이 열이 데이터 소스의 올바른 속성에 매핑되지 않으면 예외가 throw됩니다.Throws an exception if the DataGrid does not have a valid data source, or if this column is not mapped to a valid property in the data source.

ColumnStartedEditing(Control) ColumnStartedEditing(Control) ColumnStartedEditing(Control) ColumnStartedEditing(Control)

사용자가 열 편집을 시작했음을 DataGrid에 알립니다.Informs the DataGrid that the user has begun editing the column.

Commit(CurrencyManager, Int32) Commit(CurrencyManager, Int32) Commit(CurrencyManager, Int32) Commit(CurrencyManager, Int32)

파생 클래스에서 재정의된 경우 편집 프로시저를 완료하라는 요청을 시작합니다.When overridden in a derived class, initiates a request to complete an editing procedure.

ConcedeFocus() ConcedeFocus() ConcedeFocus() ConcedeFocus()

호스팅하고 있는 컨트롤에 포커스를 잃어야 하는 열을 알립니다.Notifies a column that it must relinquish the focus to the control it is hosting.

CreateHeaderAccessibleObject() CreateHeaderAccessibleObject() CreateHeaderAccessibleObject() CreateHeaderAccessibleObject()

이 열에 대한 AccessibleObject를 가져옵니다.Gets the AccessibleObject for the column.

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시 생성에 필요한 모든 관련 정보가 들어 있는 개체를 만듭니다.Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Dispose() Dispose() Dispose() Dispose()

Component에서 사용하는 모든 리소스를 해제합니다.Releases all resources used by the Component.

(Inherited from Component)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Component에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.Releases the unmanaged resources used by the Component and optionally releases the managed resources.

(Inherited from Component)
Edit(CurrencyManager, Int32, Rectangle, Boolean) Edit(CurrencyManager, Int32, Rectangle, Boolean) Edit(CurrencyManager, Int32, Rectangle, Boolean) Edit(CurrencyManager, Int32, Rectangle, Boolean)

편집할 셀을 준비합니다.Prepares a cell for editing.

Edit(CurrencyManager, Int32, Rectangle, Boolean, String) Edit(CurrencyManager, Int32, Rectangle, Boolean, String) Edit(CurrencyManager, Int32, Rectangle, Boolean, String) Edit(CurrencyManager, Int32, Rectangle, Boolean, String)

지정된 CurrencyManager, 행 번호 및 Rectangle 매개 변수를 사용하여 편집할 셀을 준비합니다.Prepares the cell for editing using the specified CurrencyManager, row number, and Rectangle parameters.

Edit(CurrencyManager, Int32, Rectangle, Boolean, String, Boolean) Edit(CurrencyManager, Int32, Rectangle, Boolean, String, Boolean) Edit(CurrencyManager, Int32, Rectangle, Boolean, String, Boolean) Edit(CurrencyManager, Int32, Rectangle, Boolean, String, Boolean)

파생하는 클래스에서 재정의된 경우 편집할 셀을 준비합니다.When overridden in a deriving class, prepares a cell for editing.

EndUpdate() EndUpdate() EndUpdate() EndUpdate()

BeginUpdate() 메서드를 호출하여 일시 중단된 열 그리기를 계속합니다.Resumes the painting of columns suspended by calling the BeginUpdate() method.

EnterNullValue() EnterNullValue() EnterNullValue() EnterNullValue()

열에 Value를 입력합니다.Enters a Value into the column.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetColumnValueAtRow(CurrencyManager, Int32) GetColumnValueAtRow(CurrencyManager, Int32) GetColumnValueAtRow(CurrencyManager, Int32) GetColumnValueAtRow(CurrencyManager, Int32)

지정한 CurrencyManager에서 지정한 행의 값을 가져옵니다.Gets the value in the specified row from the specified CurrencyManager.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

기본 해시 함수로 작동합니다.Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

이 인스턴스의 수명 정책을 제어하는 현재의 수명 서비스 개체를 검색합니다.Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetMinimumHeight() GetMinimumHeight() GetMinimumHeight() GetMinimumHeight()

파생 클래스에서 재정의된 경우 행의 최소 높이를 가져옵니다.When overridden in a derived class, gets the minimum height of a row.

GetPreferredHeight(Graphics, Object) GetPreferredHeight(Graphics, Object) GetPreferredHeight(Graphics, Object) GetPreferredHeight(Graphics, Object)

파생 클래스에서 재정의된 경우 열을 자동으로 크기 조정하는 데 사용된 높이를 가져옵니다.When overridden in a derived class, gets the height used for automatically resizing columns.

GetPreferredSize(Graphics, Object) GetPreferredSize(Graphics, Object) GetPreferredSize(Graphics, Object) GetPreferredSize(Graphics, Object)

파생 클래스에서 재정의된 경우 지정한 값의 너비와 높이를 가져옵니다.When overridden in a derived class, gets the width and height of the specified value. 너비와 높이는 DataGridTableStyle을 사용하여 DataGridColumnStyle로 이동할 때 사용됩니다.The width and height are used when the user navigates to DataGridTableStyle using the DataGridColumnStyle.

GetService(Type) GetService(Type) GetService(Type) GetService(Type)

Component 또는 해당 Container에서 제공하는 서비스를 나타내는 개체를 반환합니다.Returns an object that represents a service provided by the Component or by its Container.

(Inherited from Component)
GetType() GetType() GetType() GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
Invalidate() Invalidate() Invalidate() Invalidate()

열을 다시 그리고 그리기 메시지를 컨트롤로 보냅니다.Redraws the column and causes a paint message to be sent to the control.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
Paint(Graphics, Rectangle, CurrencyManager, Int32) Paint(Graphics, Rectangle, CurrencyManager, Int32) Paint(Graphics, Rectangle, CurrencyManager, Int32) Paint(Graphics, Rectangle, CurrencyManager, Int32)

지정한 DataGridColumnStyle, Graphics, Rectangle 및 행 번호를 사용하여 CurrencyManager을 그립니다.Paints the DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, and row number.

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

파생 클래스에서 재정의된 경우 지정한 DataGridColumnStyle, Graphics, Rectangle, 행 번호 및 맞춤을 사용하여 CurrencyManager을 그립니다.When overridden in a derived class, paints a DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, row number, and alignment.

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

지정한 DataGridColumnStyle, Graphics, Rectangle, 행 번호, 배경색, 전경색 및 맞춤을 사용하여 CurrencyManager을 그립니다.Paints a DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, row number, background color, foreground color, and alignment.

ReleaseHostedControl() ReleaseHostedControl() ReleaseHostedControl() ReleaseHostedControl()

호스팅하는 컨트롤이 필요하지 않을 때 열에서 리소스를 해제할 수 있게 합니다.Allows the column to free resources when the control it hosts is not needed.

ResetHeaderText() ResetHeaderText() ResetHeaderText() ResetHeaderText()

HeaderText를 기본값인 null로 다시 설정합니다.Resets the HeaderText to its default value, null.

SetColumnValueAtRow(CurrencyManager, Int32, Object) SetColumnValueAtRow(CurrencyManager, Int32, Object) SetColumnValueAtRow(CurrencyManager, Int32, Object) SetColumnValueAtRow(CurrencyManager, Int32, Object)

지정한 행의 값을 지정한 CurrencyManager의 값을 사용하여 설정합니다.Sets the value in a specified row with the value from a specified CurrencyManager.

SetDataGrid(DataGrid) SetDataGrid(DataGrid) SetDataGrid(DataGrid) SetDataGrid(DataGrid)

이 열이 속하는 DataGrid 컨트롤을 설정합니다.Sets the DataGrid control that this column belongs to.

SetDataGridInColumn(DataGrid) SetDataGridInColumn(DataGrid) SetDataGridInColumn(DataGrid) SetDataGridInColumn(DataGrid)

열의 DataGrid를 설정합니다.Sets the DataGrid for the column.

ToString() ToString() ToString() ToString()

Component의 이름이 포함된 String을 반환합니다(있는 경우).Returns a String containing the name of the Component, if any. 이 메서드는 재정의할 수 없습니다.This method should not be overridden.

(Inherited from Component)
UpdateUI(CurrencyManager, Int32, String) UpdateUI(CurrencyManager, Int32, String) UpdateUI(CurrencyManager, Int32, String) UpdateUI(CurrencyManager, Int32, String)

지정한 행의 값을 지정한 텍스트로 업데이트합니다.Updates the value of a specified row with the given text.

이벤트

AlignmentChanged AlignmentChanged AlignmentChanged AlignmentChanged

Alignment 속성 값이 변경되면 발생합니다.Occurs when the Alignment property value changes.

Disposed Disposed Disposed Disposed

Dispose() 메서드를 호출하여 구성 요소가 삭제되는 경우 발생합니다.Occurs when the component is disposed by a call to the Dispose() method.

(Inherited from Component)
FontChanged FontChanged FontChanged FontChanged

열의 글꼴이 변경되면 이 이벤트가 발생합니다.Occurs when the column's font changes.

HeaderTextChanged HeaderTextChanged HeaderTextChanged HeaderTextChanged

HeaderText 속성 값이 변경되면 발생합니다.Occurs when the HeaderText property value changes.

MappingNameChanged MappingNameChanged MappingNameChanged MappingNameChanged

MappingName 값이 변경될 때 발생합니다.Occurs when the MappingName value changes.

NullTextChanged NullTextChanged NullTextChanged NullTextChanged

NullText 값이 변경될 때 발생합니다.Occurs when the NullText value changes.

PropertyDescriptorChanged PropertyDescriptorChanged PropertyDescriptorChanged PropertyDescriptorChanged

PropertyDescriptor 속성 값이 변경되면 발생합니다.Occurs when the PropertyDescriptor property value changes.

ReadOnlyChanged ReadOnlyChanged ReadOnlyChanged ReadOnlyChanged

ReadOnly 속성 값이 변경되면 발생합니다.Occurs when the ReadOnly property value changes.

WidthChanged WidthChanged WidthChanged WidthChanged

Width 속성 값이 변경되면 발생합니다.Occurs when the Width property value changes.

명시적 인터페이스 구현

IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing(Control) IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing(Control) IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing(Control) IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing(Control)

사용자가 열 편집을 시작했음을 DataGrid 컨트롤에 알립니다.Informs the DataGrid control that the user has begun editing the column.

적용 대상

추가 정보