Gets or sets the preferred row height for the DataGrid control.
[Visual Basic] Public Property PreferredRowHeight As Integer [C#] public int PreferredRowHeight {get; set;} [C++] public: __property int get_PreferredRowHeight(); public: __property void set_PreferredRowHeight(int); [JScript] public function get PreferredRowHeight() : int; public function set PreferredRowHeight(int);
The height of a row.
The following example first sets a new font, and sets the PreferredRowHeight to the same height as the new font.
[Visual Basic]
Private Sub ChangeFontHeight(ByVal gd As DataGrid) ' Change the font first. gd.Font = New System.Drawing.Font("Microsoft Sans Serif", 15!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World) gd.PreferredRowHeight = gd.Font.Height End Sub
DataGrid Class | DataGrid Members | System.WinForms Namespace | GetPreferredHeight