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

GridGroupingControl - e.Style.HorizontalAlignment

Thread ID:

Created:

Updated:

Platform:

Replies:

73391 May 5,2008 03:03 PM UTC Dec 3,2008 10:57 AM UTC ASP.NET Web Forms (Classic) 4
loading
Tags: GridGroupingControl
-
Asked On May 5, 2008 03:03 PM UTC

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 02:51 PM UTC

Hi,

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";

}

aspx:





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

http://websamples.syncfusion.com/samples/Grid.Web/6.2.0.40/Grid_ASP_Alignments/main.htm


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

Regards,
Janagan.





-
Replied On May 8, 2008 08:44 AM UTC

It worked fine. Thanks a lot.


-
Replied On May 9, 2008 07:08 AM UTC

Thanks. That worked fine.


Lucie Houel
Replied On December 3, 2008 10:57 AM UTC

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.

LyLy


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

;