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.
Unfortunately, activation email could not send to your email. Please try again.

How to resize the column width and row height to client size?

Description

By default, the row height and column width is displayed in the GridControl in its default size. Therefore, when row count and column count is minimum than client size, the rows and columns are displayed as minimum and the remaining space is grayed. You can use the AllowProportionalColumnSizing property to set the column width as Client size. For more details, refer to this link: Resizing the Column width as Client size

Refer to the following screenshot.

C:\Users\ApoorvahR\AppData\Roaming\Skype\My Skype Received Files\IMG_18032015_014541.png

Figure 1: Row and Column Resizing

Solution

You can resize the row height and column width as its client size, even when it is lesser than the client size by using two custom classes. You can use the following custom classes.

  • The GridColSizingHelper class includes the customization for column width resizing according to client size using QueryColWidth event.
  • The GridRowSizingHelper class includes the customization for row height resizing according to client size using QueryRowHeight event.

C#

VB

GridColSizingHelper class customization

C#

VB

GridRowSizingHelper class customization

C#

VB

C:\Users\ApoorvahR\Desktop\Note.pngNote: For GridGroupingControl, you can resize the column width based on the client size by enabling the AllowProportionalColumnSizing property.

C#

VB

The following screenshot illustrates the resized row height and column width of Grid.

Figure 2: Resized row height and column width of Grid

Sample

C#: Resizing_Column_and_Row_to_client_size-CS

VB: Resizing_Column_and_Row_to_client_size-VB

Article ID: Published Date: Last Revised Date: Platform: Control:
4308 03/19/2015 03/19/2015 Windows Forms GridControl
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.