We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the column width and row height of the OLAP grid control?

Platform: WPF |
Control: OlapGrid |
Published Date: September 25, 2018 |
Last Revised Date: September 25, 2018
Tags: wpf, olapgrid

Customizing the column width of OLAP grid control

You can customize the column width of OLAP grid control by using the ColumnWidths property of the internal grid. You can specify the custom column width value for the specific column by using its index.

Refer to the following code sample to modify the width of second, third, and fourth columns of the OLAP grid control.

[C#]

public MainWindow()

{

            InitializeComponent();

            this.Loaded += MainWindow_Loaded;

}

private void MainWindow_Loaded(object sender, RoutedEventArgs e)

{

            this.olapgrid1.InternalGrid.ColumnWidths[1] = 110;

            this.olapgrid1.InternalGrid.ColumnWidths[2] = 130;

            this.olapgrid1.InternalGrid.ColumnWidths[3] = 150;

}

 

[VB]

Public Sub New()

           InitializeComponent()

          AddHandler Me.Loaded, AddressOf MainWindow_Loaded

End Sub

Private Sub MainWindow_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)

          Me.olapgrid1.InternalGrid.ColumnWidths(1) = 110

          Me.olapgrid1.InternalGrid.ColumnWidths(2) = 130

          Me.olapgrid1.InternalGrid.ColumnWidths(3) = 150

End Sub

 

OLAP grid rendered with default column width values

OLAP grid rendered with custom column width values

Customizing the row height of OLAP grid control

You can customize the row height of OLAP grid control by using the RowHeights property of the internal grid. You can specify the custom row height value for the specific row by using its index.

Refer to the following code sample to modify the height of second, third, and fourth rows of the OLAP grid control.

 [C#]

public MainWindow()

{

            InitializeComponent();

            this.Loaded += MainWindow_Loaded;

}

private void MainWindow_Loaded(object sender, RoutedEventArgs e)

{

            this.olapgrid1.InternalGrid. RowHeights [1] = 30;

            this.olapgrid1.InternalGrid. RowHeights [2] = 32;

            this.olapgrid1.InternalGrid. RowHeights [3] = 34;

}         

 

[VB]

Public Sub New()

          InitializeComponent()

          AddHandler Me.Loaded, AddressOf MainWindow_Loaded

End Sub

Private Sub MainWindow_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)

          Me.olapgrid1.InternalGrid.RowHeights (1) = 30

          Me.olapgrid1.InternalGrid.RowHeights (2) = 32

          Me.olapgrid1.InternalGrid.RowHeights (3) = 34

End Sub

 

OLAP grid rendered with default row height values

OLAP grid rendered with custom row height values

Note:

The reference for assemblies such as “Syncfusion.Grid.WPF.dll” and “Syncfusion.GridCommon.WPF.dll” should be added to the WPF application to customize the column width and row height of the OLAP grid control.

 

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile