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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Alignment of a column in the grid

Thread ID:





121795 Jan 26,2016 11:08 AM UTC Jan 27,2016 11:15 AM UTC WinForms 3
Tags: MultiColumnComboBox
Frank Piplak
Asked On January 26, 2016 11:08 AM UTC


I want to align a column to right and find no solution.

My code:

With MyMultiColumnList
  .DataSource = MyDataSet.Tables("MyTable")
  .DisplayMember = "ColumnName01"
  .ValueMember = "ColumnName02"
  AddHandler .ListBox.Grid.QueryCellInfo, AddressOf Grid_QueryCellInfo
  .ListBox.Grid.ColStyles.Item("ColumnName01").TextAlign = GridTextAlign.Right
End With

Have you an idea?

Best regards,

Senthil Kumaran Rajan [Syncfusion]
Replied On January 27, 2016 06:54 AM UTC

Hi Frank,

Thanks for contacting Syncfusion Support.

The reported requirement can be achieved by handling the QueryCellInfo event of the GridListBox in MultiColumnComboBox. Please make use of the below code example.

Code Example[VB]:

  Private Sub Model_QueryCellInfo(ByVal sender As Object, ByVal e As GridQueryCellInfoEventArgs)

            'To Align only the first column.

            'If e.RowIndex = 0 And e.ColIndex = 1 Then

            'To Align the columnHeader Of MultiColumnCombobox

            If e.RowIndex = 0 Then

                e.Style.HorizontalAlignment = GridHorizontalAlignment.Right

                e.Style.TextColor = Color.Red

            End If

        End Sub

We have prepared a sample for your reference and it can be downloaded from here.

Sample : http://www.syncfusion.com/downloads/support/forum/121795/ze/MultiColumnHeaderAlign-1727209248

Also, refer to the following screenshot.


Frank Piplak
Replied On January 27, 2016 10:42 AM UTC

Hello Senthil,

works fine, thank you.

Best regards,

Senthil Kumaran Rajan [Syncfusion]
Replied On January 27, 2016 11:15 AM UTC

Hi Frank,

Thank you for your update.

We are glad to know that, your requirement has been achieved. Please let us know if you need any further assistance, we will be happy to assist you.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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