NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataGrid.PreferredColumnWidth

Gets or sets the default width of the grid columns in pixels.

[Visual Basic]
Public Property PreferredColumnWidth As Integer
[C#]
public int PreferredColumnWidth {get; set;}
[C++]
public: __property int get_PreferredColumnWidth();
public: __property void set_PreferredColumnWidth(int);
[JScript]
public function get PreferredColumnWidth() : int;
public function set PreferredColumnWidth(int);

Property Value

The default width (in pixels) of columns in the grid. The default is 50.

Remarks

If this value is set to AutoColumnSize, the grid will automatically size columns to the maximum width of the first 10 rows.

Example [Visual Basic]

The following example sets the default column widths to a value passed to the method.

[Visual Basic]

Private Sub SetDefaultColWidth(defColWidth As Integer)
   DataGrid1.PreferredColumnWidth = defColWidth
End Sub

See Also

DataGrid Class | DataGrid Members | System.WinForms Namespace | AutoColumnSize