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.

GridListControl and HorizontalAlignment

Thread ID:

Created:

Updated:

Platform:

Replies:

69084 Oct 12,2007 07:36 AM Oct 12,2007 10:13 AM Windows Forms 1
loading
Tags: GridControl
Franz Gsell
Asked On October 12, 2007 07:36 AM

Hi,

I have a GLC and I want to set the HorizontalAlignment of my cells to "center". How can this be done?

I have seen that there is an option in the gridListControl.TableStyle.HorizontalAlignment but this seems to have no influence on the cells.

Cheers,
Franz

Administrator [Syncfusion]
Replied On October 12, 2007 10:13 AM

To get the alignment to 'take' in the GridListControl, I think you will need to handle the embedded grid's QueryCellInfo.

//subscribe to the event
this.gridListControl1.Grid.QueryCellInfo += new GridQueryCellInfoEventHandler(Grid_QueryCellInfo);


//the handler
void Grid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if (e.RowIndex > 0 && e.ColIndex > 0)
{
e.Style.HorizontalAlignment = GridHorizontalAlignment.Center;
}
}





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.

;