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.

Alignment of a column in the grid

Thread ID:

Created:

Updated:

Platform:

Replies:

121795 Jan 26,2016 06:08 AM Jan 27,2016 06:15 AM Windows Forms 3
loading
Tags: MultiColumnComboBox
Frank Piplak
Asked On January 26, 2016 06:08 AM

Hello,

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,
Frank

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

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.


Regards,
Senthil

Frank Piplak
Replied On January 27, 2016 05:42 AM

Hello Senthil,

works fine, thank you.

Best regards,
Frank

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

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.

Regards,
Senthil

CONFIRMATION

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.

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.

;