DataGrid.PreferredColumnWidth Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the default width of the grid columns in pixels.
public:
property int PreferredColumnWidth { int get(); void set(int value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.DataGridPreferredColumnWidthTypeConverter))]
public int PreferredColumnWidth { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.DataGridPreferredColumnWidthTypeConverter))>]
member this.PreferredColumnWidth : int with get, set
Public Property PreferredColumnWidth As Integer
Property Value
The default width (in pixels) of columns in the grid.
- Attributes
Exceptions
The property value is less than 0.
Examples
The following code example sets the default column widths to a value passed to the method.
Private Sub SetDefaultColWidth(defColWidth As Integer)
DataGrid1.PreferredColumnWidth = defColWidth
End Sub
Remarks
Set this property before resetting the DataSource and DataMember properties (either separately, or through the SetDataBinding method), or the property will have no effect.
The property cannot be set to a value less than 0.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기