# C1.Win.TouchToolKit.DataGridViewZoomPolicy.ZoomRowHeight

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_TouchToolKit_DataGridViewZoomPolicy_ZoomRowHeight_" data-uid="C1.Win.TouchToolKit.DataGridViewZoomPolicy.ZoomRowHeight*">ZoomRowHeight Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_TouchToolKit_DataGridViewZoomPolicy_ZoomRowHeight_" data-uid="C1.Win.TouchToolKit.DataGridViewZoomPolicy.ZoomRowHeight*"></a>
<h4 id="C1_Win_TouchToolKit_DataGridViewZoomPolicy_ZoomRowHeight" data-uid="C1.Win.TouchToolKit.DataGridViewZoomPolicy.ZoomRowHeight">ZoomRowHeight</h4>
<div class="markdown level1 summary"><p>Gets or sets a value indicating whether resize row's height.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool ZoomRowHeight { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Property ZoomRowHeight As Boolean</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> if resize row's height; otherwise, <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_TouchToolKit_DataGridViewZoomPolicy_ZoomRowHeight_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>
If you need to solve performance problem. see <a class="xref" href="C1.Win.TouchToolKit.DataGridViewZoomPolicy.html">DataGridViewZoomPolicy</a>.
</p>
</div>
<h5 id="C1_Win_TouchToolKit_DataGridViewZoomPolicy_ZoomRowHeight_examples">Examples</h5>
<p>
  The following code example shows how to use this property. 
</p>
<p>
  This code example is part of a larger example provided for the <a class="xref" href="C1.Win.TouchToolKit.DataGridViewZoomPolicy.html">DataGridViewZoomPolicy</a> class.
</p>
<pre><code class="lang-csharp">public class DataGridViewZoomPolicyDemo : Form
{
	private DataGridView _dataGridView;
	private CheckBox _rowHeightCheckBox;
	private GcZoom _gcZoom1 = new GcZoom();
	private DataGridViewZoomPolicy _zoomPolicy = new DataGridViewZoomPolicy();

	public DataGridViewZoomPolicyDemo()
	{
		InitializeComponent();

		_gcZoom1.Target = this;

		// Set DataGridView's ZoomPolicy object
		_gcZoom1.ZoomPolicies.Add(_zoomPolicy);

		_rowHeightCheckBox.CheckedChanged += _rowHeightCheckBox_CheckedChanged;
	}

	void _rowHeightCheckBox_CheckedChanged(object sender, EventArgs e)
	{
		_gcZoom1.ZoomFactor = 1f;
		_zoomPolicy.ZoomRowHeight = _rowHeightCheckBox.Checked;
	}

	private void InitializeComponent()
	{
		_dataGridView = new DataGridView();
		_dataGridView.Location = new Point(20, 20);
		_dataGridView.Size = new Size(400, 500);

		DataGridViewColumn column1 = new DataGridViewColumn();
		column1.CellTemplate = new DataGridViewTextBoxCell();
		column1.HeaderText = "Column 1";
		_dataGridView.Columns.Add(column1);

		DataGridViewColumn column2 = new DataGridViewColumn();
		column2.CellTemplate = new DataGridViewTextBoxCell();
		column2.HeaderText = "Column 2";
		_dataGridView.Columns.Add(column2);

		DataGridViewColumn column3 = new DataGridViewColumn();
		column3.CellTemplate = new DataGridViewTextBoxCell();
		column3.HeaderText = "Column 3";
		_dataGridView.Columns.Add(column3);

		_rowHeightCheckBox = new CheckBox();
		_rowHeightCheckBox.Text = "ZoomRowHeight";
		_rowHeightCheckBox.Size = new Size(120, 20);
		_rowHeightCheckBox.Location = new Point(450, 110);
		_rowHeightCheckBox.Checked = true;

		this.Controls.Add(_dataGridView);
		this.Controls.Add(_rowHeightCheckBox);
	}
}</code></pre>
<pre><code class="lang-csharp">Public Class DataGridViewZoomPolicyDemo
	Inherits Form
	Private _dataGridView As DataGridView
	Private _rowHeightCheckBox As CheckBox
	Private _gcZoom1 As New GcZoom()
	Private _zoomPolicy As New DataGridViewZoomPolicy()

	Public Sub New()
		InitializeComponent()

		_gcZoom1.Target = Me

		' Set DataGridView's ZoomPolicy object
		_gcZoom1.ZoomPolicies.Add(_zoomPolicy)

		AddHandler _rowHeightCheckBox.CheckedChanged, AddressOf _rowHeightCheckBox_CheckedChanged
	End Sub

	Private Sub _rowHeightCheckBox_CheckedChanged(sender As Object, e As EventArgs)
		_gcZoom1.ZoomFactor = 1.0F
		_zoomPolicy.ZoomRowHeight = _rowHeightCheckBox.Checked
	End Sub

	Private Sub InitializeComponent()
		_dataGridView = New DataGridView()
		_dataGridView.Location = New Point(20, 20)
		_dataGridView.Size = New Size(400, 500)

		Dim column1 As New DataGridViewColumn()
		column1.CellTemplate = New DataGridViewTextBoxCell()
		column1.HeaderText = "Column 1"
		_dataGridView.Columns.Add(column1)

		Dim column2 As New DataGridViewColumn()
		column2.CellTemplate = New DataGridViewTextBoxCell()
		column2.HeaderText = "Column 2"
		_dataGridView.Columns.Add(column2)

		Dim column3 As New DataGridViewColumn()
		column3.CellTemplate = New DataGridViewTextBoxCell()
		column3.HeaderText = "Column 3"
		_dataGridView.Columns.Add(column3)

		_rowHeightCheckBox = New CheckBox()
		_rowHeightCheckBox.Text = "ZoomRowHeight"
		_rowHeightCheckBox.Size = New Size(120, 20)
		_rowHeightCheckBox.Location = New Point(450, 110)
		_rowHeightCheckBox.Checked = True

		Me.Controls.Add(_dataGridView)
		Me.Controls.Add(_rowHeightCheckBox)
	End Sub
End Class</code></pre>

</div>
