DataGridBoolColumn Classe
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Attention
DataGrid is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use DataGridView instead.
Spécifie une colonne dans laquelle chaque cellule contient une case à cocher pour représenter une valeur booléenne.
public ref class DataGridBoolColumn : System::Windows::Forms::DataGridColumnStyle
public class DataGridBoolColumn : System.Windows.Forms.DataGridColumnStyle
[System.ComponentModel.Browsable(false)]
[System.Obsolete("`DataGrid` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `DataGridView` instead.", false, DiagnosticId="WFDEV006", UrlFormat="https://aka.ms/winforms-warnings/{0}")]
public class DataGridBoolColumn : System.Windows.Forms.DataGridColumnStyle
type DataGridBoolColumn = class
inherit DataGridColumnStyle
[<System.ComponentModel.Browsable(false)>]
[<System.Obsolete("`DataGrid` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `DataGridView` instead.", false, DiagnosticId="WFDEV006", UrlFormat="https://aka.ms/winforms-warnings/{0}")>]
type DataGridBoolColumn = class
inherit DataGridColumnStyle
Public Class DataGridBoolColumn
Inherits DataGridColumnStyle
- Héritage
- Attributs
Exemples
L’exemple de code suivant crée d’abord un nouveau DataGridBoolColumn code et l’ajoute à l’objet GridColumnStylesCollectionDataGridTableStyle.
using namespace System;
using namespace System::Data;
using namespace System::Windows::Forms;
using namespace System::Drawing;
using namespace System::ComponentModel;
public ref class DataGridBoolColumnInherit: public DataGridBoolColumn
{
private:
SolidBrush^ trueBrush;
SolidBrush^ falseBrush;
DataColumn^ expressionColumn;
static int count = 0;
public:
DataGridBoolColumnInherit()
: DataGridBoolColumn()
{
trueBrush = dynamic_cast<SolidBrush^>(Brushes::Blue);
falseBrush = dynamic_cast<SolidBrush^>(Brushes::Yellow);
expressionColumn = nullptr;
count++;
}
property Color FalseColor
{
Color get()
{
return falseBrush->Color;
}
void set( Color value )
{
falseBrush = gcnew System::Drawing::SolidBrush( value );
Invalidate();
}
}
property Color TrueColor
{
Color get()
{
return trueBrush->Color;
}
void set( Color value )
{
trueBrush = gcnew System::Drawing::SolidBrush( value );
Invalidate();
}
}
property String^ Expression
{
// This will work only with a DataSet or DataTable.
// The code is not compatible with IBindingList* implementations.
String^ get()
{
return this->expressionColumn == nullptr ? String::Empty : this->expressionColumn->Expression;
}
void set( String^ value )
{
if ( expressionColumn == nullptr )
AddExpressionColumn( value );
else
expressionColumn->Expression = value;
if ( expressionColumn != nullptr && expressionColumn->Expression->Equals( value ) )
return;
Invalidate();
}
}
private:
void AddExpressionColumn( String^ value )
{
// Get the grid's data source. First check for a 0
// table or data grid.
if ( this->DataGridTableStyle == nullptr || this->DataGridTableStyle->DataGrid == nullptr )
return;
DataGrid^ myGrid = this->DataGridTableStyle->DataGrid;
DataView^ myDataView = dynamic_cast<DataView^>((dynamic_cast<CurrencyManager^>(myGrid->BindingContext[ myGrid->DataSource,myGrid->DataMember ]))->List);
// This works only with System::Data::DataTable.
if ( myDataView == nullptr )
return;
// If the user already added a column with the name
// then exit. Otherwise, add the column and set the
// expression to the value passed to this function.
DataColumn^ col = myDataView->Table->Columns[ "__Computed__Column__" ];
if ( col != nullptr )
return;
col = gcnew DataColumn( String::Concat( "__Computed__Column__", count ) );
myDataView->Table->Columns->Add( col );
col->Expression = value;
expressionColumn = col;
}
// the OnPaint method to paint the cell based on the expression.
protected:
virtual void Paint( Graphics^ g, Rectangle bounds, CurrencyManager^ source, int rowNum, Brush^ backBrush, Brush^ foreBrush, bool alignToRight ) override
{
bool trueExpression = false;
bool hasExpression = false;
DataRowView^ drv = dynamic_cast<DataRowView^>(source->List[ rowNum ]);
hasExpression = this->expressionColumn != nullptr && this->expressionColumn->Expression != nullptr && !this->expressionColumn->Expression->Equals( String::Empty );
Console::WriteLine( String::Format( "hasExpressionValue {0}", hasExpression ) );
// Get the value from the expression column.
// For simplicity, we assume a True/False value for the
// expression column.
if ( hasExpression )
{
Object^ expr = drv->Row[ expressionColumn->ColumnName ];
trueExpression = expr->Equals( "True" );
}
// Let the DataGridBoolColumn do the painting.
if ( !hasExpression )
DataGridBoolColumn::Paint( g, bounds, source, rowNum, backBrush, foreBrush, alignToRight );
// Paint using the expression color for true or false, as calculated.
if ( trueExpression )
DataGridBoolColumn::Paint( g, bounds, source, rowNum, trueBrush, foreBrush, alignToRight );
else
DataGridBoolColumn::Paint( g, bounds, source, rowNum, falseBrush, foreBrush, alignToRight );
}
};
public ref class MyForm: public Form
{
private:
DataTable^ myTable;
DataGrid^ myGrid;
public:
MyForm()
{
myGrid = gcnew DataGrid;
try
{
InitializeComponent();
myTable = gcnew DataTable( "NamesTable" );
myTable->Columns->Add( gcnew DataColumn( "Name" ) );
DataColumn^ column = gcnew DataColumn( "id",Int32::typeid );
myTable->Columns->Add( column );
myTable->Columns->Add( gcnew DataColumn( "calculatedField",bool::typeid ) );
DataSet^ namesDataSet = gcnew DataSet;
namesDataSet->Tables->Add( myTable );
myGrid->SetDataBinding( namesDataSet, "NamesTable" );
AddTableStyle();
AddData();
}
catch ( System::Exception^ exc )
{
Console::WriteLine( exc );
}
}
private:
void grid_Enter( Object^ sender, EventArgs^ e )
{
myGrid->CurrentCell = DataGridCell(2,2);
}
void AddTableStyle()
{
// Map a new TableStyle to the DataTable. Then
// add DataGridColumnStyle objects to the collection
// of column styles with appropriate mappings.
DataGridTableStyle^ dgt = gcnew DataGridTableStyle;
dgt->MappingName = "NamesTable";
DataGridTextBoxColumn^ dgtbc = gcnew DataGridTextBoxColumn;
dgtbc->MappingName = "Name";
dgtbc->HeaderText = "Name";
dgt->GridColumnStyles->Add( dgtbc );
dgtbc = gcnew DataGridTextBoxColumn;
dgtbc->MappingName = "id";
dgtbc->HeaderText = "id";
dgt->GridColumnStyles->Add( dgtbc );
DataGridBoolColumnInherit^ db = gcnew DataGridBoolColumnInherit;
db->HeaderText = "less than 1000 = blue";
db->Width = 150;
db->MappingName = "calculatedField";
dgt->GridColumnStyles->Add( db );
myGrid->TableStyles->Add( dgt );
// This expression instructs the grid to change
// the color of the inherited DataGridBoolColumn
// according to the value of the id field. If it's
// less than 1000, the row is blue. Otherwise,
// the color is yellow.
db->Expression = "id < 1000";
}
void AddData()
{
// Add data with varying numbers for the id field.
// If the number is over 1000, the cell will paint
// yellow. Otherwise, it will be blue.
DataRow^ dRow = myTable->NewRow();
dRow[ "Name" ] = "name 1 ";
dRow[ "id" ] = 999;
myTable->Rows->Add( dRow );
dRow = myTable->NewRow();
dRow[ "Name" ] = "name 2";
dRow[ "id" ] = 2300;
myTable->Rows->Add( dRow );
dRow = myTable->NewRow();
dRow[ "Name" ] = "name 3";
dRow[ "id" ] = 120;
myTable->Rows->Add( dRow );
dRow = myTable->NewRow();
dRow[ "Name" ] = "name 4";
dRow[ "id" ] = 4023;
myTable->Rows->Add( dRow );
dRow = myTable->NewRow();
dRow[ "Name" ] = "name 5";
dRow[ "id" ] = 2345;
myTable->Rows->Add( dRow );
myTable->AcceptChanges();
}
void InitializeComponent()
{
this->Size = System::Drawing::Size( 500, 500 );
myGrid->Size = System::Drawing::Size( 350, 250 );
myGrid->TabStop = true;
myGrid->TabIndex = 1;
this->StartPosition = FormStartPosition::CenterScreen;
this->Controls->Add( myGrid );
}
};
[STAThread]
int main()
{
Application::Run( gcnew MyForm );
}
using System;
using System.Data;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
public class MyForm : Form
{
private DataTable myTable;
private DataGrid myGrid = new DataGrid();
public MyForm() : base()
{
try
{
InitializeComponent();
myTable = new DataTable("NamesTable");
myTable.Columns.Add(new DataColumn("Name"));
DataColumn column = new DataColumn
("id", typeof(System.Int32));
myTable.Columns.Add(column);
myTable.Columns.Add(new
DataColumn("calculatedField", typeof(bool)));
DataSet namesDataSet = new DataSet();
namesDataSet.Tables.Add(myTable);
myGrid.SetDataBinding(namesDataSet, "NamesTable");
AddTableStyle();
AddData();
}
catch (System.Exception exc)
{
Console.WriteLine(exc.ToString());
}
}
private void grid_Enter(object sender, EventArgs e)
{
myGrid.CurrentCell = new DataGridCell(2,2);
}
private void AddTableStyle()
{
// Map a new TableStyle to the DataTable. Then
// add DataGridColumnStyle objects to the collection
// of column styles with appropriate mappings.
DataGridTableStyle dgt = new DataGridTableStyle();
dgt.MappingName = "NamesTable";
DataGridTextBoxColumn dgtbc = new DataGridTextBoxColumn();
dgtbc.MappingName = "Name";
dgtbc.HeaderText= "Name";
dgt.GridColumnStyles.Add(dgtbc);
dgtbc = new DataGridTextBoxColumn();
dgtbc.MappingName = "id";
dgtbc.HeaderText= "id";
dgt.GridColumnStyles.Add(dgtbc);
DataGridBoolColumnInherit db =
new DataGridBoolColumnInherit();
db.HeaderText= "less than 1000 = blue";
db.Width= 150;
db.MappingName = "calculatedField";
dgt.GridColumnStyles.Add(db);
myGrid.TableStyles.Add(dgt);
// This expression instructs the grid to change
// the color of the inherited DataGridBoolColumn
// according to the value of the id field. If it's
// less than 1000, the row is blue. Otherwise,
// the color is yellow.
db.Expression = "id < 1000";
}
private void AddData()
{
// Add data with varying numbers for the id field.
// If the number is over 1000, the cell will paint
// yellow. Otherwise, it will be blue.
DataRow dRow = myTable.NewRow();
dRow["Name"] = "name 1 ";
dRow["id"] = 999;
myTable.Rows.Add(dRow);
dRow = myTable.NewRow();
dRow["Name"] = "name 2";
dRow["id"] = 2300;
myTable.Rows.Add(dRow);
dRow = myTable.NewRow();
dRow["Name"] = "name 3";
dRow["id"] = 120;
myTable.Rows.Add(dRow);
dRow = myTable.NewRow();
dRow["Name"] = "name 4";
dRow["id"] = 4023;
myTable.Rows.Add(dRow);
dRow = myTable.NewRow();
dRow["Name"] = "name 5";
dRow["id"] = 2345;
myTable.Rows.Add(dRow);
myTable.AcceptChanges();
}
private void InitializeComponent()
{
this.Size = new Size(500, 500);
myGrid.Size = new Size(350, 250);
myGrid.TabStop = true;
myGrid.TabIndex = 1;
this.StartPosition = FormStartPosition.CenterScreen;
this.Controls.Add(myGrid);
}
[STAThread]
public static void Main()
{
Application.Run(new MyForm());
}
}
public class DataGridBoolColumnInherit : DataGridBoolColumn
{
private SolidBrush trueBrush = Brushes.Blue as SolidBrush;
private SolidBrush falseBrush = Brushes.Yellow as SolidBrush;
private DataColumn expressionColumn = null;
private static int count = 0;
public Color FalseColor
{
get
{
return falseBrush.Color;
}
set
{
falseBrush = new SolidBrush(value);
Invalidate();
}
}
public Color TrueColor
{
get
{
return trueBrush.Color;
}
set
{
trueBrush = new SolidBrush(value);
Invalidate();
}
}
public DataGridBoolColumnInherit() : base ()
{
count ++;
}
// This will work only with a DataSet or DataTable.
// The code is not compatible with IBindingList implementations.
public string Expression
{
get
{
return this.expressionColumn == null ? String.Empty :
this.expressionColumn.Expression;
}
set
{
if (expressionColumn == null)
AddExpressionColumn(value);
else
expressionColumn.Expression = value;
if (expressionColumn != null &&
expressionColumn.Expression.Equals(value))
return;
Invalidate();
}
}
private void AddExpressionColumn(string value)
{
// Get the grid's data source. First check for a null
// table or data grid.
if (this.DataGridTableStyle == null ||
this.DataGridTableStyle.DataGrid == null)
return;
DataGrid myGrid = this.DataGridTableStyle.DataGrid;
DataView myDataView = ((CurrencyManager)
myGrid.BindingContext[myGrid.DataSource,
myGrid.DataMember]).List
as DataView;
// This works only with System.Data.DataTable.
if (myDataView == null)
return;
// If the user already added a column with the name
// then exit. Otherwise, add the column and set the
// expression to the value passed to this function.
DataColumn col = myDataView.Table.Columns["__Computed__Column__"];
if (col != null)
return;
col = new DataColumn("__Computed__Column__" + count.ToString());
myDataView.Table.Columns.Add(col);
col.Expression = value;
expressionColumn = col;
}
// override the OnPaint method to paint the cell based on the expression.
protected override void Paint(Graphics g, Rectangle bounds,
CurrencyManager source, int rowNum,
Brush backBrush, Brush foreBrush,
bool alignToRight)
{
bool trueExpression = false;
bool hasExpression = false;
DataRowView drv = source.List[rowNum] as DataRowView;
hasExpression = this.expressionColumn != null &&
this.expressionColumn.Expression != null &&
!this.expressionColumn.Expression.Equals(String.Empty);
Console.WriteLine(string.Format("hasExpressionValue {0}",hasExpression));
// Get the value from the expression column.
// For simplicity, we assume a True/False value for the
// expression column.
if (hasExpression)
{
object expr = drv.Row[expressionColumn.ColumnName];
trueExpression = expr.Equals("True");
}
// Let the DataGridBoolColumn do the painting.
if (!hasExpression)
base.Paint(g, bounds, source, rowNum,
backBrush, foreBrush, alignToRight);
// Paint using the expression color for true or false, as calculated.
if (trueExpression)
base.Paint(g, bounds, source, rowNum,
trueBrush, foreBrush, alignToRight);
else
base.Paint(g, bounds, source, rowNum,
falseBrush, foreBrush, alignToRight);
}
}
Imports System.Data
Imports System.Windows.Forms
Imports System.Drawing
Imports System.ComponentModel
Public Class MyForm
Inherits System.Windows.Forms.Form
Private components As System.ComponentModel.Container
Private myTable As DataTable
Private myGrid As DataGrid = New DataGrid()
Public Shared Sub Main()
Application.Run(New MyForm())
End Sub
Public Sub New()
Try
InitializeComponent()
myTable = New DataTable("NamesTable")
myTable.Columns.Add(New DataColumn("Name"))
Dim column As DataColumn = New DataColumn _
("id", GetType(System.Int32))
myTable.Columns.Add(column)
myTable.Columns.Add(New DataColumn _
("calculatedField", GetType(Boolean)))
Dim namesDataSet As DataSet = New DataSet("myDataSet")
namesDataSet.Tables.Add(myTable)
myGrid.SetDataBinding(namesDataSet, "NamesTable")
AddData()
AddTableStyle()
Catch exc As System.Exception
Console.WriteLine(exc.ToString)
End Try
End Sub
Private Sub AddTableStyle()
' Map a new TableStyle to the DataTable. Then
' add DataGridColumnStyle objects to the collection
' of column styles with appropriate mappings.
Dim dgt As DataGridTableStyle = New DataGridTableStyle()
dgt.MappingName = "NamesTable"
Dim dgtbc As DataGridTextBoxColumn = _
New DataGridTextBoxColumn()
dgtbc.MappingName = "Name"
dgtbc.HeaderText = "Name"
dgt.GridColumnStyles.Add(dgtbc)
dgtbc = New DataGridTextBoxColumn()
dgtbc.MappingName = "id"
dgtbc.HeaderText = "id"
dgt.GridColumnStyles.Add(dgtbc)
Dim db As DataGridBoolColumnInherit = _
New DataGridBoolColumnInherit()
db.HeaderText = "less than 1000 = blue"
db.Width = 150
db.MappingName = "calculatedField"
dgt.GridColumnStyles.Add(db)
myGrid.TableStyles.Add(dgt)
' This expression instructs the grid to change
' the color of the inherited DataGridBoolColumn
' according to the value of the id field. If it's
' less than 1000, the row is blue. Otherwise,
' the color is yellow.
db.Expression = "id < 1000"
End Sub
Private Sub AddData()
' Add data with varying numbers for the id field.
' If the number is over 1000, the cell will paint
' yellow. Otherwise, it will be blue.
Dim dRow As DataRow
dRow = myTable.NewRow()
dRow("Name") = "name 1"
dRow("id") = 999
myTable.Rows.Add(dRow)
dRow = myTable.NewRow()
dRow("Name") = "name 2"
dRow("id") = 2300
myTable.Rows.Add(dRow)
dRow = myTable.NewRow()
dRow("Name") = "name 3"
dRow("id") = 120
myTable.Rows.Add(dRow)
dRow = myTable.NewRow()
dRow("Name") = "name 4"
dRow("id") = 4023
myTable.Rows.Add(dRow)
dRow = myTable.NewRow()
dRow("Name") = "name 5"
dRow("id") = 2345
myTable.Rows.Add(dRow)
myTable.AcceptChanges()
End Sub
Private Sub InitializeComponent()
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
End Class
Public Class DataGridBoolColumnInherit
Inherits DataGridBoolColumn
Private trueBrush As SolidBrush = Brushes.Blue
Private falseBrush As SolidBrush = Brushes.Yellow
Private expressionColumn As DataColumn = Nothing
Shared count As Int32 = 0
Public Property FalseColor() As Color
Get
Return falseBrush.Color
End Get
Set(ByVal Value As Color)
falseBrush = New SolidBrush(Value)
Invalidate()
End Set
End Property
Public Property TrueColor() As Color
Get
Return trueBrush.Color
End Get
Set(ByVal Value As Color)
trueBrush = New SolidBrush(Value)
Invalidate()
End Set
End Property
Public Sub New()
count += 1
End Sub
' This will work only with a DataSet or DataTable.
' The code is not compatible with IBindingList implementations.
Public Property Expression() As String
Get
If Me.expressionColumn Is Nothing Then
Return String.Empty
Else
Return Me.expressionColumn.Expression
End If
End Get
Set(ByVal Value As String)
If expressionColumn Is Nothing Then
AddExpressionColumn(Value)
Else
expressionColumn.Expression = Value
End If
If (expressionColumn IsNot Nothing) And expressionColumn.Expression.Equals(Value) Then
Return
End If
Invalidate()
End Set
End Property
Private Sub AddExpressionColumn(ByVal value As String)
' Get the grid's data source. First check for a null
' table or data grid.
If Me.DataGridTableStyle Is Nothing Or _
Me.DataGridTableStyle.DataGrid Is Nothing Then
Return
End If
Dim dg As DataGrid = Me.DataGridTableStyle.DataGrid
Dim dv As DataView = CType(dg.BindingContext(dg.DataSource, dg.DataMember), CurrencyManager).List
' This works only with System.Data.DataTable.
If dv Is Nothing Then
Return
End If
' If the user already added a column with the name
' then exit. Otherwise, add the column and set the
' expression to the value passed to this function.
Dim col As DataColumn = dv.Table.Columns("__Computed__Column__")
If (col IsNot Nothing) Then
Return
End If
col = New DataColumn("__Computed__Column__" + count.ToString())
dv.Table.Columns.Add(col)
col.Expression = value
expressionColumn = col
End Sub
' Override the OnPaint method to paint the cell based on the expression.
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 trueExpression As Boolean = False
Dim hasExpression As Boolean = False
Dim drv As DataRowView = [source].List(rowNum)
hasExpression = (Me.expressionColumn IsNot Nothing) And (Me.expressionColumn.Expression IsNot Nothing) And Not Me.expressionColumn.Expression.Equals([String].Empty)
' Get the value from the expression column.
' For simplicity, we assume a True/False value for the
' expression column.
If hasExpression Then
Dim expr As Object = drv.Row(expressionColumn.ColumnName)
trueExpression = expr.Equals("True")
End If
' Let the DataGridBoolColumn do the painting.
If Not hasExpression Then
MyBase.Paint(g, bounds, [source], rowNum, backBrush, foreBrush, alignToRight)
End If
' Paint using the expression color for true or false, as calculated.
If trueExpression Then
MyBase.Paint(g, bounds, [source], rowNum, trueBrush, foreBrush, alignToRight)
Else
MyBase.Paint(g, bounds, [source], rowNum, falseBrush, foreBrush, alignToRight)
End If
End Sub
End Class
Remarques
Dérive DataGridBoolColumn de la abstract classe DataGridColumnStyle. Au moment de l’exécution, les DataGridBoolColumn cases à cocher contenues dans chaque cellule qui ont trois états par défaut : cochées (true), décochées (false) et Value. Pour utiliser des cases à cocher à deux états, définissez la AllowNull propriété falsesur .
Les propriétés ajoutées à la classe incluent FalseValue, NullValueet TrueValue. Ces propriétés spécifient la valeur sous-jacente à chacun des états de la colonne.
Constructeurs
| Nom | Description |
|---|---|
| DataGridBoolColumn() |
Obsolète.
Initialise une nouvelle instance de la classe DataGridBoolColumn. |
| DataGridBoolColumn(PropertyDescriptor, Boolean) |
Obsolète.
Initialise une nouvelle instance de la DataGridBoolColumn classe avec le style de colonne spécifié PropertyDescriptoret spécifie si le style de colonne est une colonne par défaut. |
| DataGridBoolColumn(PropertyDescriptor) |
Obsolète.
Initialise une nouvelle instance de la DataGridBoolColumn classe avec le fichier spécifié PropertyDescriptor. |
Propriétés
| Nom | Description |
|---|---|
| Alignment |
Obsolète.
Obtient ou définit l’alignement du texte dans une colonne. (Hérité de DataGridColumnStyle) |
| AllowNull |
Obsolète.
Obtient ou définit une valeur indiquant si les valeurs Null sont autorisées. |
| CanRaiseEvents |
Obsolète.
Obtient une valeur indiquant si le composant peut déclencher un événement. (Hérité de Component) |
| Container |
Obsolète.
Obtient le IContainer fichier qui contient le Component. (Hérité de Component) |
| DataGridTableStyle |
Obsolète.
Obtient la DataGridTableStyle colonne. (Hérité de DataGridColumnStyle) |
| DesignMode |
Obsolète.
Obtient une valeur qui indique si la Component valeur est actuellement en mode création. (Hérité de Component) |
| Events |
Obsolète.
Obtient la liste des gestionnaires d’événements qui sont attachés à ce Component. (Hérité de Component) |
| FalseValue |
Obsolète.
Obtient ou définit la valeur réelle utilisée lors de la définition de la valeur de la colonne |
| FontHeight |
Obsolète.
Obtient la hauteur de la police de la colonne. (Hérité de DataGridColumnStyle) |
| HeaderAccessibleObject |
Obsolète.
Obtient la AccessibleObject colonne. (Hérité de DataGridColumnStyle) |
| HeaderText |
Obsolète.
Obtient ou définit le texte de l’en-tête de colonne. (Hérité de DataGridColumnStyle) |
| MappingName |
Obsolète.
Obtient ou définit le nom du membre de données sur lequel mapper le style de colonne. (Hérité de DataGridColumnStyle) |
| NullText |
Obsolète.
Obtient ou définit le texte affiché lorsque la colonne contient |
| NullValue |
Obsolète.
Obtient ou définit la valeur réelle utilisée lors de la définition de la valeur de la colonne Valuesur . |
| PropertyDescriptor |
Obsolète.
Obtient ou définit les PropertyDescriptor attributs des données affichées par le DataGridColumnStyle. (Hérité de DataGridColumnStyle) |
| ReadOnly |
Obsolète.
Obtient ou définit une valeur indiquant si les données de la colonne peuvent être modifiées. (Hérité de DataGridColumnStyle) |
| Site |
Obsolète.
Obtient ou définit le ISiteComponent. (Hérité de Component) |
| TrueValue |
Obsolète.
Obtient ou définit la valeur réelle utilisée lors de la définition de la valeur de la colonne |
| Width |
Obsolète.
Obtient ou définit la largeur de la colonne. (Hérité de DataGridColumnStyle) |
Méthodes
| Nom | Description |
|---|---|
| Abort(Int32) |
Obsolète.
Lance une demande d’interruption d’une procédure d’édition. |
| BeginUpdate() |
Obsolète.
Suspend la peinture de la colonne jusqu’à ce que la EndUpdate() méthode soit appelée. (Hérité de DataGridColumnStyle) |
| CheckValidDataSource(CurrencyManager) |
Obsolète.
Lève une exception si la DataGrid source de données n’a pas de source de données valide ou si cette colonne n’est pas mappée à une propriété valide dans la source de données. (Hérité de DataGridColumnStyle) |
| ColumnStartedEditing(Control) |
Obsolète.
Informe que DataGrid l’utilisateur a commencé à modifier la colonne. (Hérité de DataGridColumnStyle) |
| Commit(CurrencyManager, Int32) |
Obsolète.
Lance une demande d’exécution d’une procédure d’édition. |
| ConcedeFocus() |
Obsolète.
Avertit une colonne qu’elle doit abandonner le focus au contrôle qu’il héberge. |
| ConcedeFocus() |
Obsolète.
Avertit une colonne qu’elle doit abandonner le focus au contrôle qu’il héberge. (Hérité de DataGridColumnStyle) |
| CreateHeaderAccessibleObject() |
Obsolète.
Obtient la AccessibleObject colonne. (Hérité de DataGridColumnStyle) |
| CreateObjRef(Type) |
Obsolète.
Crée un objet qui contient toutes les informations pertinentes requises pour générer un proxy utilisé pour communiquer avec un objet distant. (Hérité de MarshalByRefObject) |
| Dispose() |
Obsolète.
Libère toutes les ressources utilisées par le Component. (Hérité de Component) |
| Dispose(Boolean) |
Obsolète.
Libère les ressources non managées utilisées par les Component ressources gérées et libère éventuellement les ressources managées. (Hérité de Component) |
| Edit(CurrencyManager, Int32, Rectangle, Boolean, String, Boolean) |
Obsolète.
Prépare la cellule pour modifier une valeur. |
| Edit(CurrencyManager, Int32, Rectangle, Boolean, String) |
Obsolète.
Prépare la cellule à modifier à l’aide du numéro de ligne et Rectangle des paramètres spécifiésCurrencyManager. (Hérité de DataGridColumnStyle) |
| Edit(CurrencyManager, Int32, Rectangle, Boolean) |
Obsolète.
Prépare une cellule pour modification. (Hérité de DataGridColumnStyle) |
| EndUpdate() |
Obsolète.
Reprend la peinture des colonnes suspendues en appelant la BeginUpdate() méthode. (Hérité de DataGridColumnStyle) |
| EnterNullValue() |
Obsolète.
Entre une Value colonne. |
| EnterNullValue() |
Obsolète.
Entre une Value colonne. (Hérité de DataGridColumnStyle) |
| Equals(Object) |
Obsolète.
Détermine si l’objet spécifié est égal à l’objet actuel. (Hérité de Object) |
| GetColumnValueAtRow(CurrencyManager, Int32) |
Obsolète.
Obtient la valeur à la ligne spécifiée. |
| GetColumnValueAtRow(CurrencyManager, Int32) |
Obsolète.
Obtient la valeur de la ligne spécifiée à partir de l’objet spécifié CurrencyManager. (Hérité de DataGridColumnStyle) |
| GetHashCode() |
Obsolète.
Sert de fonction de hachage par défaut. (Hérité de Object) |
| GetLifetimeService() |
Obsolète.
Récupère l’objet de service de durée de vie actuel qui contrôle la stratégie de durée de vie de cette instance. (Hérité de MarshalByRefObject) |
| GetMinimumHeight() |
Obsolète.
Obtient la hauteur d’une cellule dans une colonne. |
| GetPreferredHeight(Graphics, Object) |
Obsolète.
Obtient la hauteur utilisée lors du redimensionnement des colonnes. |
| GetPreferredSize(Graphics, Object) |
Obsolète.
Obtient la largeur et la hauteur optimales d’une cellule en fonction d’une valeur spécifique à contenir. |
| GetService(Type) |
Obsolète.
Retourne un objet qui représente un service fourni par le Component ou par son Container. (Hérité de Component) |
| GetType() |
Obsolète.
Obtient la Type de l’instance actuelle. (Hérité de Object) |
| InitializeLifetimeService() |
Obsolète.
Obtient un objet de service de durée de vie pour contrôler la stratégie de durée de vie de cette instance. (Hérité de MarshalByRefObject) |
| Invalidate() |
Obsolète.
Redessine la colonne et provoque l’envoi d’un message de peinture au contrôle. (Hérité de DataGridColumnStyle) |
| MemberwiseClone() |
Obsolète.
Crée une copie superficielle du Objectactuel. (Hérité de Object) |
| MemberwiseClone(Boolean) |
Obsolète.
Crée une copie superficielle de l’objet actuel MarshalByRefObject . (Hérité de MarshalByRefObject) |
| Paint(Graphics, Rectangle, CurrencyManager, Int32, Boolean) |
Obsolète.
Dessine les DataGridBoolColumn paramètres d’alignement et de Rectanglenuméro de ligne donnésGraphics. |
| Paint(Graphics, Rectangle, CurrencyManager, Int32, Brush, Brush, Boolean) |
Obsolète.
Dessine l’objet DataGridBoolColumn avec le nombre de lignes donnéGraphicsRectangle, le numéro de ligne et BrushColor. |
| Paint(Graphics, Rectangle, CurrencyManager, Int32, Brush, Brush, Boolean) |
Obsolète.
Peint un DataGridColumnStyle avec le numéro de RectangleCurrencyManagerligne, le numéro de ligne, la couleur d’arrière-plan, la couleur de premier plan et l’alignement spécifiésGraphics. (Hérité de DataGridColumnStyle) |
| Paint(Graphics, Rectangle, CurrencyManager, Int32) |
Obsolète.
Dessine le DataGridBoolColumn numéro de ligne et le numéro de ligne donnésGraphicsRectangle. |
| ReleaseHostedControl() |
Obsolète.
Permet à la colonne de libérer des ressources lorsque le contrôle qu’il héberge n’est pas nécessaire. (Hérité de DataGridColumnStyle) |
| ResetHeaderText() |
Obsolète.
Réinitialise la HeaderText valeur par défaut. |
| SetColumnValueAtRow(CurrencyManager, Int32, Object) |
Obsolète.
Définit la valeur d’une ligne spécifiée. |
| SetColumnValueAtRow(CurrencyManager, Int32, Object) |
Obsolète.
Définit la valeur dans une ligne spécifiée avec la valeur d’un élément spécifié CurrencyManager. (Hérité de DataGridColumnStyle) |
| SetDataGrid(DataGrid) |
Obsolète.
Définit le DataGrid contrôle auquel appartient cette colonne. (Hérité de DataGridColumnStyle) |
| SetDataGridInColumn(DataGrid) |
Obsolète.
Définit la DataGrid colonne. (Hérité de DataGridColumnStyle) |
| ToString() |
Obsolète.
Retourne un String nom contenant le nom du Component, le cas échéant. Cette méthode ne doit pas être remplacée. (Hérité de Component) |
| UpdateUI(CurrencyManager, Int32, String) |
Obsolète.
Met à jour la valeur d’une ligne spécifiée avec le texte donné. (Hérité de DataGridColumnStyle) |
Événements
| Nom | Description |
|---|---|
| AlignmentChanged |
Obsolète.
Se produit lorsque la valeur de propriété Alignment change. (Hérité de DataGridColumnStyle) |
| AllowNullChanged |
Obsolète.
Se produit lorsque la AllowNull propriété est modifiée. |
| Disposed |
Obsolète.
Se produit lorsque le composant est supprimé par un appel à la Dispose() méthode. (Hérité de Component) |
| FalseValueChanged |
Obsolète.
Se produit lorsque la FalseValue propriété est modifiée. |
| FontChanged |
Obsolète.
Se produit lorsque la police de la colonne change. (Hérité de DataGridColumnStyle) |
| HeaderTextChanged |
Obsolète.
Se produit lorsque la valeur de propriété HeaderText change. (Hérité de DataGridColumnStyle) |
| MappingNameChanged |
Obsolète.
Se produit lorsque la MappingName valeur change. (Hérité de DataGridColumnStyle) |
| NullTextChanged |
Obsolète.
Se produit lorsque la NullText valeur change. (Hérité de DataGridColumnStyle) |
| PropertyDescriptorChanged |
Obsolète.
Se produit lorsque la valeur de propriété PropertyDescriptor change. (Hérité de DataGridColumnStyle) |
| ReadOnlyChanged |
Obsolète.
Se produit lorsque la valeur de propriété ReadOnly change. (Hérité de DataGridColumnStyle) |
| TrueValueChanged |
Obsolète.
Se produit lorsque la valeur de la TrueValue propriété est modifiée. |
| WidthChanged |
Obsolète.
Se produit lorsque la valeur de propriété Width change. (Hérité de DataGridColumnStyle) |
Implémentations d’interfaces explicites
| Nom | Description |
|---|---|
| IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing(Control) |
Obsolète.
Informe le DataGrid contrôle que l’utilisateur a commencé à modifier la colonne. (Hérité de DataGridColumnStyle) |