RowSizing プロパティは、指定されたオーバーライドによって制御されるバンドまたはグリッドで、ユーザーがマウスを使用して行のサイズを変更できるかどうか、変更できる場合にはどのようにしてサイズを変更するかを指定します。グリッドでは、行を構成するセル内のデータの量に基づいて自動的に行のサイズを変更することもできます。1つのセルに長いテキストが含まれている場合、セルに複数のテキスト行を表示可能であれば、すべてのテキストまたは特定の行数のテキストが収まるように行のサイズを変更できます。また、RowSizing プロパティは、行を個別にリサイズできるようにするか、またはすべての行の高さを同期させるかを決定します。
自動サイズ設定の 1 つを使用する場合、各行のサイズはセルの内容を表示するために必要なテキスト行の数によって決まります。その行で最も多くのテキスト行を表示するセルが、行全体のサイズを決定します。CellMultiLine プロパティは、セルのテキストが複数行に折り返されるかどうかを指定します。使用されるテキスト行の数は、RowSizingAutoMaxLines プロパティの設定によって制限できます。
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub Button79_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button79.Click ' Set the RowSizing on the layout's override to Free so the rows in the UltraGrid ' can be resized independently. By default, row heights are syncronized so when one ' row is resized, all the rows in that band will be rezied to that height. Me.UltraGrid1.DisplayLayout.Override.RowSizing = RowSizing.Free ' Set DefaultRowHeight off the layout's override to 20 so all the rows in the UltraGrid ' are sized to 20. Me.UltraGrid1.DisplayLayout.Override.DefaultRowHeight = 20 ' RowSizingArea indicates which part of a row can be used to resize the row. By default, ' the user can resize rows using the row-selectors. You can set it to EntireRow to allow ' resizing using the entire row and not just the row-selector. Me.UltraGrid1.DisplayLayout.Override.RowSizingArea = RowSizingArea.EntireRow ' You can override that grid-wide setting for a particular band by setting it on the ' override of that band. Set the RowSizing to Fixed to prevent the user from reszing ' rows. Me.UltraGrid1.DisplayLayout.Bands(1).Override.RowSizing = RowSizing.Fixed Me.UltraGrid1.DisplayLayout.Bands(1).Override.DefaultRowHeight = 40 ' With the RowSizing modes of AutoFree and AutoFixed, the UltraGrid resizes the rows ' based on its contents. By default, the UltraGrid will resize the row without any ' limit. You can use the RowSizingAutoMaxLines property to limit the row-autosizing ' to a certain number of lines. Me.UltraGrid1.DisplayLayout.Bands(2).Override.RowSizing = RowSizing.AutoFree Me.UltraGrid1.DisplayLayout.Bands(2).Override.RowSizingAutoMaxLines = 5 End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void button79_Click(object sender, System.EventArgs e) { // Set the RowSizing on the layout's override to Free so the rows in the UltraGrid // can be resized independently. By default, row heights are syncronized so when one // row is resized, all the rows in that band will be rezied to that height. this.ultraGrid1.DisplayLayout.Override.RowSizing = RowSizing.Free; // Set DefaultRowHeight off the layout's override to 20 so all the rows in the UltraGrid // are sized to 20. this.ultraGrid1.DisplayLayout.Override.DefaultRowHeight = 20; // RowSizingArea indicates which part of a row can be used to resize the row. By default, // the user can resize rows using the row-selectors. You can set it to EntireRow to allow // resizing using the entire row and not just the row-selector. this.ultraGrid1.DisplayLayout.Override.RowSizingArea = RowSizingArea.EntireRow; // You can override that grid-wide setting for a particular band by setting it on the // override of that band. Set the RowSizing to Fixed to prevent the user from reszing // rows. this.ultraGrid1.DisplayLayout.Bands[1].Override.RowSizing = RowSizing.Fixed; this.ultraGrid1.DisplayLayout.Bands[1].Override.DefaultRowHeight = 40; // With the RowSizing modes of AutoFree and AutoFixed, the UltraGrid resizes the rows // based on its contents. By default, the UltraGrid will resize the row without any // limit. You can use the RowSizingAutoMaxLines property to limit the row-autosizing // to a certain number of lines. this.ultraGrid1.DisplayLayout.Bands[2].Override.RowSizing = RowSizing.AutoFree; this.ultraGrid1.DisplayLayout.Bands[2].Override.RowSizingAutoMaxLines = 5; }