DataGridViewColumn.InheritedAutoSizeMode DataGridViewColumn.InheritedAutoSizeMode DataGridViewColumn.InheritedAutoSizeMode DataGridViewColumn.InheritedAutoSizeMode Property

定義

取得資料行的作用中調整大小模式。Gets the sizing mode in effect for the column.

public:
 property System::Windows::Forms::DataGridViewAutoSizeColumnMode InheritedAutoSizeMode { System::Windows::Forms::DataGridViewAutoSizeColumnMode get(); };
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.DataGridViewAutoSizeColumnMode InheritedAutoSizeMode { get; }
member this.InheritedAutoSizeMode : System.Windows.Forms.DataGridViewAutoSizeColumnMode
Public ReadOnly Property InheritedAutoSizeMode As DataGridViewAutoSizeColumnMode

屬性值

備註

資料行的自動調整大小行為是由InheritedAutoSizeMode屬性的值所決定,這與所有值的AutoSizeMode屬性值相同,但NotSet表示值繼承自DataGridView.AutoSizeColumnsMode屬性。The automatic sizing behavior of the column is determined by the value of the InheritedAutoSizeMode property, which is the same as the value of the AutoSizeMode property for all values except NotSet, which indicates that the value is inherited from the DataGridView.AutoSizeColumnsMode property instead.

當屬性值為Fill時,資料行會隨著該模式中的其他資料行調整大小,讓控制項中所有可見的資料行完全填滿可用顯示區域的水準寬度。 InheritedAutoSizeModeWhen the InheritedAutoSizeMode property value is Fill, the column is resized along with other columns in that mode so that all visible columns in the control exactly fill the horizontal width of the available display area. 控制項中的所有填滿模式資料行都會以其FillWeight屬性值所決定的比例來分割可用空間。All fill-mode columns in the control divide the available space in proportions determined by their FillWeight property values. 如需資料行填滿模式的詳細資訊,請參閱Windows Forms DataGridView 控制項中的資料行填滿模式For more information about column fill mode, see Column Fill Mode in the Windows Forms DataGridView Control.

當屬性設定為以外None的任何其他值時,資料行會管理其寬度,以便在不裁剪的情況下完全顯示其資料格的值。 InheritedAutoSizeModeWhen the InheritedAutoSizeMode property is set to any other value except None, the column will manage its width so that its cell values are fully displayed without clipping. 在以內容為基礎的調整大小模式中,每當資料格內容變更WrapMode時,就會進行大小調整,或在每次資料列高度變更時,In content-based sizing modes, size adjustments occur whenever cell contents change or, if WrapMode is enabled, whenever row heights change. 某些以內容為基礎的調整大小模式可讓您限制目前顯示之資料列的大小調整,以提升效能。Some content-based sizing modes let you limit the size adjustment to the currently displayed rows in order to increase performance.

只有Visible屬性值為的true資料行調整大小,而變更資料行的可見度並不會造成調整大小。Only columns with a Visible property value of true are resized, and changing the visibility of a column does not cause resizing to occur. 此外,當資料行設定為自動調整大小時,使用者就無法使用滑鼠來調整資料行寬度。Additionally, when columns are set to automatically resize, the user cannot adjust the column widths with the mouse.

若要以程式設計方式調整資料DataGridView行寬度AutoResizeColumnAutoResizeColumns請使用控制項的或Width方法,或設定資料行屬性。To adjust column widths programmatically, use the DataGridView control's AutoResizeColumn or AutoResizeColumns methods or set the column Width property.

如需以內容為基礎之自動調整大小的詳細資訊,請參閱Windows Forms DataGridView 控制項中的調整大小選項For more information about content-based automatic sizing, see Sizing Options in the Windows Forms DataGridView Control.

適用於

另請參閱