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.
Syncfusion Feedback

how to set horizontal alignment in a GridList Control

Thread ID:

Created:

Updated:

Platform:

Replies:

112496 Sep 25,2013 12:10 PM Sep 29,2013 11:47 PM Windows Forms 1
loading
Tags: GridControl
Carlos Alberto Dávila Cantú
Asked On September 25, 2013 12:10 PM

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 29, 2013 11:47 PM

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.

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

;