Width プロパティは、オブジェクトの横のサイズを決定します。このサイズは通常オブジェクトのコンテナーの座標系で表されますが、ピクセルで指定することも可能です。
比例サイズ変更を UltraGridColumn および UltraGridGroup オブジェクトで使用すると、隣接する列またはグリッド自体のサイズが変更されるため、列の幅は列が占有する領域のサイズを変更するとそれに対応して増減します。
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub Button121_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button121.Click ' Get the band to have the groups in. Dim band As UltraGridBand = Me.UltraGrid1.DisplayLayout.Bands(0) ' Clear existing groups if any. band.Groups.Clear() ' Add a group with the key of G1 and the caption of Address Info. band.Groups.Add("G1", "Address Info") ' Add some columns to the group. band.Groups("G1").Columns.Add(band.Columns("CustomerID"), 0) band.Groups("G1").Columns.Add(band.Columns("ContactName"), 1) band.Groups("G1").Columns.Add(band.Columns("City"), 2) band.Groups("G1").Columns.Add(band.Columns("Region"), 3) band.Groups("G1").Columns.Add(band.Columns("Country"), 4) End Sub Private Sub Button120_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button120.Click Dim group As UltraGridGroup = Me.UltraGrid1.DisplayLayout.Bands(0).Groups("G1") ' Set Width to 600. Extent property returns the same value as Width but unlike ' Width, Extent is read-only. group.Width = 600 Debug.WriteLine("Group width = " & group.Width & ", Extent = " & group.Extent) ' Set the appearance of the group header. group.Header.Appearance.BackColor = Color.Red ' You can change the caption by setting the caption. group.Header.Caption = "Group Caption" ' You can also set the appearance of cells in columns that belong to this group. group.CellAppearance.BackColor = Color.LightSkyBlue End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void button121_Click(object sender, System.EventArgs e) { // Get the band to have the groups in. UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0]; // Clear existing groups if any. band.Groups.Clear( ); // Add a group with the key of G1 and the caption of Address Info. band.Groups.Add( "G1", "Address Info" ); // Add some columns to the group. band.Groups["G1"].Columns.Add( band.Columns["CustomerID"], 0 ); band.Groups["G1"].Columns.Add( band.Columns["ContactName"], 1 ); band.Groups["G1"].Columns.Add( band.Columns["City"], 2 ); band.Groups["G1"].Columns.Add( band.Columns["Region"], 3 ); band.Groups["G1"].Columns.Add( band.Columns["Country"], 4 ); } private void button120_Click(object sender, System.EventArgs e) { UltraGridGroup group = this.ultraGrid1.DisplayLayout.Bands[0].Groups["G1"]; // Set Width to 600. Extent property returns the same value as Width but unlike // Width, Extent is read-only. group.Width = 600; Debug.WriteLine( "Group width = " + group.Width + ", Extent = " + group.Extent ); // Set the appearance of the group header. group.Header.Appearance.BackColor = Color.Red; // You can change the caption by setting the caption. group.Header.Caption = "Group Caption"; // You can also set the appearance of cells in columns that belong to this group. group.CellAppearance.BackColor = Color.LightSkyBlue; }