DataGridColumn.CanUserResize DataGridColumn.CanUserResize DataGridColumn.CanUserResize DataGridColumn.CanUserResize Property


取得或設定值,這個值表示使用者是否可以使用滑鼠來調整資料行寬度。Gets or sets a value that indicates whether the user can adjust the column width by using the mouse.

 property bool CanUserResize { bool get(); void set(bool value); };
public bool CanUserResize { get; set; }
member this.CanUserResize : bool with get, set
Public Property CanUserResize As Boolean


如果使用者可以調整資料行大小,則為 true,否則為 falsetrue if the user can resize the column; otherwise, false. 已註冊的預設值是 trueThe registered default is true. 如需哪些因素會影響值的詳細資訊,請參閱 DependencyPropertyFor information about what can influence the value, see DependencyProperty.


這個屬性不會影響資料行寬度是否可以透過程式設計方式變更,例如藉Width由變更屬性。This property does not affect whether column widths can be changed programmatically, such as by changing the Width property.

您可以藉由設定DataGrid.CanUserResizeColumns屬性來設定所有資料行的這個調整大小行為。You can set this resize behavior for all columns by setting the DataGrid.CanUserResizeColumns property. 如果同時DataGridColumn.CanUserResize DataGrid.CanUserResizeColumns 設定了true屬性和屬性,的值會優先于的值。falseIf the DataGridColumn.CanUserResize property and the DataGrid.CanUserResizeColumns property are both set, a value of false takes precedence over a value of true.