)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

What is the difference between the alignment in WinForms GridControl?

Platform: WinForms |
Control: GridControl |
Published Date: April 30, 2011 |
Last Revised Date: December 20, 2019

Difference between the alignment in GridControl

TextAlign is set when the description of embedded controls is to be aligned to the left or right. For example, in a combobox cell, setting the TextAlign to right aligns the text to the right of the combobox button.

HorizontalAlignment is set, when the cell value is to be aligned either left or right or center of the cell. In the same way the VerticalAlignment is set, when the cell value is to be aligned either at the top or bottom or at the middle of the cell.

C#

// set text alignment as right
this.gridControl1.ColStyles[2].TextAlign = GridTextAlign.Right;
// set horizontal alignment
this.gridControl1.ColStyles[3].HorizontalAlignment = GridHorizontalAlignment.Center;
// set Vertical alignment
this.gridControl1.ColStyles[4].VerticalAlignment = GridVerticalAlignment.Bottom;

VB

' set text alignment as right
Me.gridControl1.ColStyles(2).TextAlign = GridTextAlign.Right
' set horizontal alignment
Me.gridControl1.ColStyles(3).HorizontalAlignment = GridHorizontalAlignment.Center
' set Vertical alignment
Me.gridControl1.ColStyles(4).VerticalAlignment = GridVerticalAlignment.Bottom

The following screenshot illustrates the alignment in GridControl.

Alignment in GridControl

Figure 1: Alignment in GridControl

Note:

The default text alignment is left.

 

Samples:

C#: Alignments

VB:

Alignments

2X faster development

The ultimate WinForms 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
Live Chat Icon