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.

GridGroupingControl - e.Style.HorizontalAlignment

Thread ID:





73391 May 5,2008 11:03 AM Dec 3,2008 05:57 AM ASP.NET Web Forms (Classic) 4
Tags: GridGroupingControl
Asked On May 5, 2008 11:03 AM

Hi, I'm trying to center the contents of a particular cell in an ASP.NET GridGroupingControl through the OnQueryCellStyleInfo event.
However, the e.Style.HorizontalAlignment = GridHorizontalAlignment.Center is not working.
Is there an alternative way to center the contents of the cell? Thanks.

Janagan [Syncfusion]
Replied On May 7, 2008 10:51 AM


You can center the contents of the cell by the custom css class through querycellstyleinfo event as mentioned in the code below:

Code Behind:

protected void GridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Web.UI.WebControls.Grid.Grouping.GridTableCellStyleInfoEventArgs e)

e.Style.CssClass = "cellalign";



Please refer the sample in the link below which illustrates the above:


Please try running the sample and let me know if this helps.


Replied On May 8, 2008 04:44 AM

It worked fine. Thanks a lot.

Replied On May 9, 2008 03:08 AM

Thanks. That worked fine.

Lucie Houel
Replied On December 3, 2008 05:57 AM

Hi everyone,

I've got the same issue and the solution given works fine to me. The thing is that css properties are applied for all the row. How can I apply the css class for only one cell ?

Thanks a lot for the help.



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.