DataGridTableStyle.DataGridTableStyle(CurrencyManager) Constructor
.NET Framework 3.0
Initializes a new instance of the DataGridTableStyle class with the specified CurrencyManager.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
Assembly: System.Windows.Forms (in system.windows.forms.dll)
The following code example creates a new DataGridTableStyle using a CurrencyManager for a DataTable.
private void CreateDataGridGridTableStyle(){ CurrencyManager myCurrencyManager; DataGridTableStyle myGridTableStyle; /* Get the CurrencyManager for a DataTable named "Customers" found in a DataSet named "myDataSet". */ myCurrencyManager = (CurrencyManager) BindingContext[myDataSet, "Customers"]; myGridTableStyle = new DataGridTableStyle(myCurrencyManager); // Add the table style to the collection of a DataGrid. myDataGrid.TableStyles.Add(myGridTableStyle); }
private void CreateDataGridGridTableStyle()
{
CurrencyManager myCurrencyManager;
DataGridTableStyle myGridTableStyle;
/* Get the CurrencyManager for a DataTable named "Customers"
found in a DataSet named "myDataSet".
*/
myCurrencyManager =
(CurrencyManager)( get_BindingContext().
get_Item(myDataSet, "Customers"));
myGridTableStyle = new DataGridTableStyle(myCurrencyManager);
// Add the table style to the collection of a DataGrid.
myDataGrid.get_TableStyles().Add(myGridTableStyle);
} //CreateDataGridGridTableStyle
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.