DataGrid.PreferredRowHeight Özellik

Tanım

Denetim için DataGrid tercih edilen satır yüksekliğini alır veya ayarlar.

public:
 property int PreferredRowHeight { int get(); void set(int value); };
public int PreferredRowHeight { get; set; }
member this.PreferredRowHeight : int with get, set
Public Property PreferredRowHeight As Integer

Özellik Değeri

Int32

Satırın yüksekliği.

Örnekler

Aşağıdaki kod örneği önce yeni bir yazı tipi ayarlar ve öğesini PreferredRowHeight yeni yazı tipiyle aynı yüksekliğe ayarlar.

private:
   void ChangeFontHeight( DataGrid^ myGrid )
   {
      myGrid->Font = gcnew System::Drawing::Font(
         "Microsoft Sans Serif",
         15, System::Drawing::FontStyle::Regular );
      myGrid->PreferredRowHeight = myGrid->Font->Height;
   }
private void ChangeFontHeight(DataGrid myGrid)
{
   myGrid.Font = new System.Drawing.Font
      ("Microsoft Sans Serif",
      15, System.Drawing.FontStyle.Regular);
   myGrid.PreferredRowHeight = myGrid.Font.Height;
}
Private Sub ChangeFontHeight(ByVal myGrid As DataGrid)
   ' Change the font first.
   myGrid.Font = New System.Drawing.Font _
   ("Microsoft Sans Serif", 15, _
   System.Drawing.FontStyle.Regular)

   myGrid.PreferredRowHeight = myGrid.Font.Height
End Sub

Açıklamalar

ve DataMember özelliklerini sıfırlamadan DataSource önce (ayrı olarak veya yöntemi aracılığıylaSetDataBinding) bu özelliği ayarlayın; aksi takdirde özelliğin hiçbir etkisi olmaz.

Şunlara uygulanır

Ayrıca bkz.