Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions WindowsForms/Pivot-Grid/Pivot-Columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,41 @@ End Class
{% endhighlight %}

{% endtabs %}

## Set Width for the columns

The width of the columns can be changed by using the `QueryColWidth` event.

Refer the below code sample to change the width of the columns by using the column index.

{% tabs %}

{% highlight c# %}

pivotGridControl1.TableModel.QueryColWidth += TableModel_QueryColWidth;

private void TableModel_QueryColWidth(object sender, Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs e)
{
if (e.Index > 2)
{
e.Size = 150;
e.Handled = true;
}
}

{% endhighlight %}

{% highlight vb %}

AddHandler pivotGridControl1.TableModel.QueryColWidth, AddressOf TableModel_QueryColWidth

Private Sub TableModel_QueryColWidth(sender As Object, e As Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs)
If e.Index > 2 Then
e.Size = 150
e.Handled = True
End If
End Sub

{% endhighlight %}

{% endtabs %}
39 changes: 39 additions & 0 deletions WindowsForms/Pivot-Grid/Pivot-Rows.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,42 @@ End Class
{% endhighlight %}

{% endtabs %}

## Set Height for the rows

The height of the rows can be changed by using the `QueryRowHeight` event.

Refer the below code sample to change the height of the rows by using the row index.

{% tabs %}

{% highlight c# %}

pivotGridControl1.TableModel.QueryRowHeight += TableModel_QueryRowHeight;

private void TableModel_QueryRowHeight(object sender, Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs e)
{
if (e.Index > 2)
{
e.Size = 16;
e.Handled = true;
}
}

{% endhighlight %}

{% highlight vb %}

AddHandler pivotGridControl1.TableModel.QueryRowHeight, AddressOf TableModel_QueryRowHeight

Private Sub TableModel_QueryRowHeight(sender As Object, e As GridRowColSizeEventArgs)
If e.Index > 2 Then
e.Size = 16
e.Handled = True
End If
End Sub

{% endhighlight %}

{% endtabs %}