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

how to set horizontal alignment in a GridList Control

Thread ID:

Created:

Updated:

Platform:

Replies:

112496 Sep 25,2013 04:10 PM UTC Sep 30,2013 03:47 AM UTC WinForms 1
loading
Tags: GridControl
Carlos Alberto Dávila Cantú
Asked On September 25, 2013 04:10 PM UTC

Hello Team, 

I am using GridListControl but I can't set the horizontal alignment to center of one column, I try with:

 

GridListControl1.Grid.Model.ColStyles(1).HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Center

 

But this doesn't work.

 

Thanks,
Carlos


Arun Kumar V [Syncfusion]
Replied On September 30, 2013 03:47 AM UTC

Hi Carlos,

Thanks for your interest in Syncfusion products.

Query:

set the horizontal alignment to center of one column

Thanks for sharing the information. You could make use of the following Querycellinfo event. This event will be triggered continuously. So please make use of the following event.

 

Code Snippet:

this.gridListControl1.Grid.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo);

void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)

{

if (e.ColIndex == 5)

{

e.Style.HorizontalAlignment = GridHorizontalAlignment.Center;

}

}

 

Please let me know if you have any concerns.

Regards,

Arun.


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.

Please sign in to access our forum

or the page will be automatically redirected to 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

;