DataGridTableStyle.DataGrid Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the DataGrid control for the drawn table.
public:
virtual property System::Windows::Forms::DataGrid ^ DataGrid { System::Windows::Forms::DataGrid ^ get(); void set(System::Windows::Forms::DataGrid ^ value); };
[System.ComponentModel.Browsable(false)]
public virtual System.Windows.Forms.DataGrid DataGrid { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.DataGrid : System.Windows.Forms.DataGrid with get, set
Public Overridable Property DataGrid As DataGrid
Property Value
The DataGrid control that displays the table.
- Attributes
Examples
The following code example prints the CurrentCell of the System.Windows.Forms.DataGrid displaying a DataGridTableStyle.
private:
void GetSelectedIndex( DataGridTableStyle^ myGridTable )
{
/* Get the name of the DataGrid of the DataGridTable
passed as an argument. */
Console::WriteLine( myGridTable->DataGrid->CurrentCell.ToString() );
}
private void GetSelectedIndex(DataGridTableStyle myGridTable)
{
/* Get the name of the DataGrid of the DataGridTable
passed as an argument. */
Console.WriteLine(myGridTable.DataGrid.CurrentCell.ToString());
}
Private Sub GetSelectedIndex(myGridTable As DataGridTableStyle)
' Get the name of the DataGrid of the DataGridTable
' passed as an argument.
Console.WriteLine(myGridTable.DataGrid.CurrentCell.ToString())
End Sub
Remarks
The System.Windows.Forms.DataGrid control displays data in the form of a grid. The DataGridTableStyle is an object that represents the drawn grid. The System.Windows.Forms.DataGrid property returns a reference to the control that is displaying the grid.
The DataGrid property is set when a DataGridTableStyle is added to a System.Windows.Forms.DataGrid control's GridTableStylesCollection. You should not try to set this property unless you are overriding it and creating a designer for a user control that incorporates the DataGrid control.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈