diff --git a/WindowsForms/Pivot-Grid/Pivot-Columns.md b/WindowsForms/Pivot-Grid/Pivot-Columns.md index b48ca6be5..fbb1c4e6c 100644 --- a/WindowsForms/Pivot-Grid/Pivot-Columns.md +++ b/WindowsForms/Pivot-Grid/Pivot-Columns.md @@ -147,3 +147,43 @@ End Class {% endhighlight %} {% endtabs %} + +## Set the width for the pivot columns + +The width of the pivot columns can be changed using the `QueryColWidth` event. + +Refer the below code snippet to change the width of the pivot 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 == 4) + { + e.Size = 150; + e.Handled = true; + } + } + +{% endhighlight %} + +{% highlight vb %} + +AddHandler pivotGridControl1.TableModel.QueryColWidth, AddressOf TableModel_QueryColWidth + +Private Sub TableModel_QueryColWidth(ByVal sender As Object,ByVal e As Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs) + If e.Index == 4 Then + e.Size = 150 + e.Handled = True + End If +End Sub + +{% endhighlight %} + +{% endtabs %} + +![Changing Row height in Winforms PivotGrid Control](Pivot-Columns_images/column.png) diff --git a/WindowsForms/Pivot-Grid/Pivot-Columns_images/column.png b/WindowsForms/Pivot-Grid/Pivot-Columns_images/column.png new file mode 100644 index 000000000..1dd5d8c00 Binary files /dev/null and b/WindowsForms/Pivot-Grid/Pivot-Columns_images/column.png differ diff --git a/WindowsForms/Pivot-Grid/Pivot-Rows.md b/WindowsForms/Pivot-Grid/Pivot-Rows.md index 6366dae97..f949c1300 100644 --- a/WindowsForms/Pivot-Grid/Pivot-Rows.md +++ b/WindowsForms/Pivot-Grid/Pivot-Rows.md @@ -147,3 +147,44 @@ End Class {% endhighlight %} {% endtabs %} + +## Set the height for the pivot rows + +The height of the pivot rows can be changed using the `QueryRowHeight` event. + +Refer the below code snippet to change the height of the pivot 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(ByVal sender As Object,ByVal e As GridRowColSizeEventArgs) + If e.Index > 2 Then + e.Size = 16 + e.Handled = True + End If +End Sub + +{% endhighlight %} + +{% endtabs %} + +![Changing Row height in Winforms PivotGrid Control](Pivot-Rows_images/Height.png) + diff --git a/WindowsForms/Pivot-Grid/Pivot-Rows_images/Height.png b/WindowsForms/Pivot-Grid/Pivot-Rows_images/Height.png new file mode 100644 index 000000000..97fc6e0bf Binary files /dev/null and b/WindowsForms/Pivot-Grid/Pivot-Rows_images/Height.png differ