GridColumnStylesCollection.AddRange メソッド
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As GridColumnStylesCollection Dim columns As DataGridColumnStyle() instance.AddRange(columns)

DataGridColumnStyle オブジェクトの配列を作成し、AddRange メソッドを使用して、その配列を GridColumnStylesCollection に追加するコード例を次に示します。
Private Sub AddStyleRange() ' Create two DataGridColumnStyle objects. Dim col1 As New DataGridTextBoxColumn() col1.MappingName = "FirstName" Dim col2 As New DataGridBoolColumn() col2.MappingName = "Current" ' Create an array and use AddRange to add to collection. Dim cols() As DataGridColumnStyle = {col1, col2} dataGrid1.TableStyles(0).GridColumnStyles.AddRange(cols) End Sub
private void AddStyleRange() { // Create two DataGridColumnStyle objects. DataGridColumnStyle col1 = new DataGridTextBoxColumn(); col1.MappingName = "FirstName"; DataGridColumnStyle col2 = new DataGridBoolColumn(); col2.MappingName = "Current"; // Create an array and use AddRange to add to collection. DataGridColumnStyle[] cols = new DataGridColumnStyle[2] {col1, col2}; dataGrid1.TableStyles[0].GridColumnStyles.AddRange(cols); }
void AddStyleRange() { // Create two DataGridColumnStyle objects. DataGridColumnStyle^ col1 = gcnew DataGridTextBoxColumn; col1->MappingName = "FirstName"; DataGridColumnStyle^ col2 = gcnew DataGridBoolColumn; col2->MappingName = "Current"; // Create an array and use AddRange to add to collection. array<DataGridColumnStyle^>^cols = {col1,col2}; dataGrid1->TableStyles[ 0 ]->GridColumnStyles->AddRange( cols ); }
private void AddStyleRange() { // Create two DataGridColumnStyle objects. DataGridColumnStyle col1 = new DataGridTextBoxColumn(); col1.set_MappingName("FirstName"); DataGridColumnStyle col2 = new DataGridBoolColumn(); col2.set_MappingName("Current"); // Create an array and use AddRange to add to collection. DataGridColumnStyle cols[] = new DataGridColumnStyle[] { col1, col2 }; dataGrid1.get_TableStyles().get_Item(0).get_GridColumnStyles(). AddRange(cols); } //AddStyleRange
function AddStyleRange(dataGrid: DataGrid) { // Create two DataGridColumnStyle objects. var col1: DataGridColumnStyle = new DataGridTextBoxColumn(); col1.MappingName = "FirstName"; var col2: DataGridColumnStyle = new DataGridBoolColumn(); col2.MappingName = "Current"; // Create an array and use AddRange to add to collection. var cols: DataGridColumnStyle[] = [col1, col2]; dataGrid.TableStyles[0].GridColumnStyles.AddRange(cols); }

Windows 98, Windows 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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- GridColumnStylesCollection.AddRange メソッドのページへのリンク